Skip to contentSkip to conversation

Makefile: Force GNU hashing

PATCH New Mayuresh Chitale 3 participants 8 messages Aug 14, 2023 – Aug 15, 2023 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: Force GNU hashing

The Yocto QA step verifies that binaries and DSOs use DT_GNU_HASH rather than DT_HASH. If the linker is called directly, then we need to make sure to pass in the hashing style.

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index 730dbd9..7fb8d2d 100644
@@ -161,7 +161,7 @@ ifeq ($(LD_IS_LLD),y)
 RELAX_FLAG	=	-mno-relax
 USE_LD_FLAG	=	-fuse-ld=lld
 else
-USE_LD_FLAG	=	-fuse-ld=bfd
+USE_LD_FLAG	=	-fuse-ld=bfd -Wl,--hash-style=gnu
 endif
 
 # Check whether the linker supports creating PIEs
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/1 Makefile: Force GNU hashing

Quoted 3 lines · Mayuresh Chitale

The Yocto QA step verifies that binaries and DSOs use DT_GNU_HASH rather than DT_HASH. If the linker is called directly, then we need to make sure to pass in the hashing style.

Why does it matter? The ultimate output is a flat binary.

Signature · 3 lines
Andreas Schwab, SUSE Labs, schwab at suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
#2 lore raw

PATCH 1/1 Makefile: Force GNU hashing

Quoted 7 lines · Andreas Schwab
Quoted 3 lines · Mayuresh Chitale

The Yocto QA step verifies that binaries and DSOs use DT_GNU_HASH rather than DT_HASH. If the linker is called directly, then we need to make sure to pass in the hashing style.

Why does it matter? The ultimate output is a flat binary.

It matters because the Yocto QA step will fail. It doesn't affect the behavior of the resulting image though, IIRC.

Jeff

#3 lore raw

PATCH 1/1 Makefile: Force GNU hashing

Quoted 8 lines · Jeff Law
Quoted 6 lines · Andreas Schwab
Quoted 3 lines · Mayuresh Chitale

The Yocto QA step verifies that binaries and DSOs use DT_GNU_HASH rather than DT_HASH. If the linker is called directly, then we need to make sure to pass in the hashing style.

Why does it matter? The ultimate output is a flat binary.

It matters because the Yocto QA step will fail.

Why does it even look at it? It's only an intermediate build product.

Signature · 3 lines
Andreas Schwab, SUSE Labs, schwab at suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
#4 lore raw

PATCH 1/1 Makefile: Force GNU hashing

Quoted 5 lines · Andreas Schwab
Quoted 3 lines · Jeff Law
Quoted 2 lines · Andreas Schwab

On Aug 14 2023, Mayuresh Chitale wrote:

Quoted 7 lines
Quoted 5 lines
Quoted 4 lines
Quoted 3 lines

The Yocto QA step verifies that binaries and DSOs use DT_GNU_HASH rather than DT_HASH. If the linker is called directly, then we need to make sure to pass in the hashing style.

Why does it matter? The ultimate output is a flat binary.

It matters because the Yocto QA step will fail.

Why does it even look at it? It's only an intermediate build product.

Because that's how Yocto works? Hell if I know and it wasn't something I wanted to spend a lot of time investigating. Fighting with Yocto over something that doesn't change the behavior of the resulting image isn't something I felt was worth a lot of my time -- for various reasons.

jeff

#5 lore raw

PATCH 1/1 Makefile: Force GNU hashing

Quoted 6 lines · Jeff Law
Quoted 5 lines · Andreas Schwab
Quoted 3 lines · Jeff Law
Quoted 2 lines · Andreas Schwab

On Aug 14 2023, Mayuresh Chitale wrote:

Quoted 7 lines
Quoted 6 lines
Quoted 5 lines
Quoted 4 lines
Quoted 3 lines

The Yocto QA step verifies that binaries and DSOs use DT_GNU_HASH rather than DT_HASH. If the linker is called directly, then we need to make sure to pass in the hashing style.

Why does it matter? The ultimate output is a flat binary.

It matters because the Yocto QA step will fail.

Why does it even look at it? It's only an intermediate build product.

Because that's how Yocto works?

Whatever Yocto is, it must be doing something strange.

Signature · 3 lines
Andreas Schwab, SUSE Labs, schwab at suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
#6 lore raw

PATCH 1/1 Makefile: Force GNU hashing

Quoted 11 lines · Andreas Schwab
Quoted 9 lines · Jeff Law
Quoted 8 lines · Andreas Schwab
Quoted 6 lines · Jeff Law
Quoted 5 lines · Andreas Schwab
Quoted 3 lines · Mayuresh Chitale

The Yocto QA step verifies that binaries and DSOs use DT_GNU_HASH rather than DT_HASH. If the linker is called directly, then we need to make sure to pass in the hashing style.

Quoted 6 lines
Quoted 4 lines
Quoted 3 lines
Quoted 2 lines
Quoted 1 line

Why does it matter? The ultimate output is a flat binary.

It matters because the Yocto QA step will fail.

Why does it even look at it? It's only an intermediate build product.

Because that's how Yocto works?

Whatever Yocto is, it must be doing something strange.

There are many things about Yocto that are strange at best. IMHO Yocto is a necessary evil as part of the bring-up process but you want to get away from it as soon as possible :-)

If you've never worked with it, consider yourself lucky. Think of it as a mini distro, but with a unique and complex way of describing the components of the distro and how they're patched/built, how qa works, etc.

jeff

#7 lore raw

PATCH 1/1 Makefile: Force GNU hashing

If they want GNU hashing, they should configure the linker accordingly, instead of forcing their policy to everyone else.

Signature · 3 lines
Andreas Schwab, SUSE Labs, schwab at suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."