Skip to contentSkip to conversation

gcc-cross: default linker hash style to sysv

PATCH In review Christopher Larson 3 participants 4 messages Jul 7, 2016 – Jul 8, 2016

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 gcc-cross: default linker hash style to sysv

From: Christopher Larson <[email protected]>

We explicitly set the hash style to gnu in our LDFLAGS. Setting the default to this in the toolchain, while convenient, actually hides bugs, as a failure to obey LDFLAGS isn't noticed. By removing this, it's not dissimilar to how we poison the sysroot -- rather than relying on the default, notice right away if somoeone isn't obeying the needed flags.

This will result in a failure to obey LDFLAGS causing a GNU_HASH QA failure, which is what's often seen with external toolchains. This brings us all on the same page, and makes sure a failure to obey LDFLAGS is seen early.

This is limited to cross, to retain ease of use for SDKs.

---

Supercedes '[PATCHv2] gcc-cross: remove --with-linker-hash-style' v3 changes: per khem's advice, switched to use of LINKER_HASH_STYLE

meta/recipes-devtools/gcc/gcc-cross.inc +5 -0
index f479360..c0b8751 100644
@@ -13,6 +13,11 @@ PN = "gcc-cross-${TARGET_ARCH}"
 
 require gcc-configure-common.inc
 
+# While we want the 'gnu' hash style, we explicitly set it to sysv here to
+# ensure that any recipe which doesn't obey our LDFLAGS (which also set it to
+# gnu) will hit a QA failure.
+LINKER_HASH_STYLE ?= "sysv"
+
 EXTRA_OECONF += "--enable-poison-system-directories"
 EXTRA_OECONF_append_sh4 = " \
     --with-multilib-list= \
Signature · 1 line
2.8.0
#1 lore raw
Quoted 25 lines · Christopher Larson

From: Christopher Larson <[email protected]>

We explicitly set the hash style to gnu in our LDFLAGS. Setting the default to this in the toolchain, while convenient, actually hides bugs, as a failure to obey LDFLAGS isn't noticed. By removing this, it's not dissimilar to how we poison the sysroot -- rather than relying on the default, notice right away if somoeone isn't obeying the needed flags.

This will result in a failure to obey LDFLAGS causing a GNU_HASH QA failure, which is what's often seen with external toolchains. This brings us all on the same page, and makes sure a failure to obey LDFLAGS is seen early.

This is limited to cross, to retain ease of use for SDKs.

---

Supercedes '[PATCHv2] gcc-cross: remove --with-linker-hash-style' v3 changes: per khem's advice, switched to use of LINKER_HASH_STYLE

meta/recipes-devtools/gcc/gcc-cross.inc +0 -0
index f479360..c0b8751 100644

meta/recipes-devtools/gcc/gcc-cross.inc PN = "gcc-cross-${TARGET_ARCH}" · line 19

Quoted 7 lines
meta/recipes-devtools/gcc/gcc-cross.inc +4 -0
@@ -13,6 +13,11 @@ PN = "gcc-cross-${TARGET_ARCH}"
 
 require gcc-configure-common.inc
 
+# While we want the 'gnu' hash style, we explicitly set it to sysv here to
+# ensure that any recipe which doesn't obey our LDFLAGS (which also set it to
+# gnu) will hit a QA failure.
+LINKER_HASH_STYLE ?= "sysv"

Defining a new variable (LINKER_HASH_STYLE_INVERSE ?) and setting it to the opposite of whatever bitbake.conf ends up assigning to LINKER_HASH_STYLE might be clearer here.

Otherwise MIPS toolchains will continue to default to the same hash style as MIPS LDFLAGS.

Quoted 12 lines
meta/recipes-devtools/gcc/gcc-cross.inc +1 -1
+
 EXTRA_OECONF += "--enable-poison-system-directories"
 EXTRA_OECONF_append_sh4 = " \
     --with-multilib-list= \
--

2.8.0

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#2 lore raw
Quoted 38 lines · Andre McCurdy
Quoted 25 lines · Christopher Larson

From: Christopher Larson <[email protected]>

We explicitly set the hash style to gnu in our LDFLAGS. Setting the default to this in the toolchain, while convenient, actually hides bugs, as a failure to obey LDFLAGS isn't noticed. By removing this, it's not dissimilar to how we poison the sysroot -- rather than relying on the default, notice right away if somoeone isn't obeying the needed flags.

This will result in a failure to obey LDFLAGS causing a GNU_HASH QA failure, which is what's often seen with external toolchains. This brings us all on the same page, and makes sure a failure to obey LDFLAGS is seen early.

This is limited to cross, to retain ease of use for SDKs.

---

Supercedes '[PATCHv2] gcc-cross: remove --with-linker-hash-style' v3 changes: per khem's advice, switched to use of LINKER_HASH_STYLE

meta/recipes-devtools/gcc/gcc-cross.inc +0 -0
index f479360..c0b8751 100644

meta/recipes-devtools/gcc/gcc-cross.inc PN = "gcc-cross-${TARGET_ARCH}" · line 19

Quoted 7 lines
meta/recipes-devtools/gcc/gcc-cross.inc +4 -0
@@ -13,6 +13,11 @@ PN = "gcc-cross-${TARGET_ARCH}"
 
 require gcc-configure-common.inc
 
+# While we want the 'gnu' hash style, we explicitly set it to sysv here to
+# ensure that any recipe which doesn't obey our LDFLAGS (which also set it to
+# gnu) will hit a QA failure.
+LINKER_HASH_STYLE ?= "sysv"

Defining a new variable (LINKER_HASH_STYLE_INVERSE ?) and setting it to the opposite of whatever bitbake.conf ends up assigning to LINKER_HASH_STYLE might be clearer here.

Quoted 2 lines

Otherwise MIPS toolchains will continue to default to the same hash style as MIPS LDFLAGS.

Dont understand what you mean here. However for mips sysv is the only option.

Quoted 18 lines
Quoted 8 lines
meta/recipes-devtools/gcc/gcc-cross.inc +1 -1
+
 EXTRA_OECONF += "--enable-poison-system-directories"
 EXTRA_OECONF_append_sh4 = " \
     --with-multilib-list= \
--

2.8.0

Quoted 5 lines

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#3 lore raw
Quoted 39 lines · Khem Raj
Quoted 38 lines · Andre McCurdy
Quoted 25 lines · Christopher Larson

From: Christopher Larson <[email protected]>

We explicitly set the hash style to gnu in our LDFLAGS. Setting the default to this in the toolchain, while convenient, actually hides bugs, as a failure to obey LDFLAGS isn't noticed. By removing this, it's not dissimilar to how we poison the sysroot -- rather than relying on the default, notice right away if somoeone isn't obeying the needed flags.

This will result in a failure to obey LDFLAGS causing a GNU_HASH QA failure, which is what's often seen with external toolchains. This brings us all on the same page, and makes sure a failure to obey LDFLAGS is seen early.

This is limited to cross, to retain ease of use for SDKs.

---

Supercedes '[PATCHv2] gcc-cross: remove --with-linker-hash-style' v3 changes: per khem's advice, switched to use of LINKER_HASH_STYLE

meta/recipes-devtools/gcc/gcc-cross.inc +0 -0
index f479360..c0b8751 100644

meta/recipes-devtools/gcc/gcc-cross.inc PN = "gcc-cross-${TARGET_ARCH}" · line 19

Quoted 7 lines
meta/recipes-devtools/gcc/gcc-cross.inc +4 -0
@@ -13,6 +13,11 @@ PN = "gcc-cross-${TARGET_ARCH}"
 
 require gcc-configure-common.inc
 
+# While we want the 'gnu' hash style, we explicitly set it to sysv here to
+# ensure that any recipe which doesn't obey our LDFLAGS (which also set it to
+# gnu) will hit a QA failure.
+LINKER_HASH_STYLE ?= "sysv"

Defining a new variable (LINKER_HASH_STYLE_INVERSE ?) and setting it to the opposite of whatever bitbake.conf ends up assigning to LINKER_HASH_STYLE might be clearer here.

Quoted 4 lines
Quoted 2 lines

Otherwise MIPS toolchains will continue to default to the same hash style as MIPS LDFLAGS.

Dont understand what you mean here. However for mips sysv is the only option.

OK, I hadn't realised that you can't even configure gcc for gnu hashes for MIPS. If that's the case then having the MIPS toolchain default to the same hash style as the MIPS LDFLAGS is the only option.

Quoted 18 lines
Quoted 18 lines
Quoted 8 lines
meta/recipes-devtools/gcc/gcc-cross.inc +1 -1
+
 EXTRA_OECONF += "--enable-poison-system-directories"
 EXTRA_OECONF_append_sh4 = " \
     --with-multilib-list= \
--

2.8.0

Quoted 5 lines

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core