tools: disable linker --as-needed option
PATCH 1/1 tools: disable linker --as-needed option
# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1296550939 0
# Node ID a3fb60cc3be3dc6596ed8395e0eb70514bdfcc74 # Parent 5b6663ba2bb2c54e8fa6745afa16297ebe43328d
tools: disable linker --as-needed option.
The Xen build system is not currently compatible with the --as-needed linker option. The proper fix for this is turning out to be rather invasive to the build system so simply disable for now with the intention of revisiting for the 4.2 release.
The $(COMMA) trick allows "," in macro arguments.
Reported/Tested-by: Nathan March <[email protected]>
tools/Rules.mk +4 -0
@@ -55,6 +55,10 @@ LDFLAGS += $(shell getconf LFS_LDFLAGS) LDFLAGS += $(shell getconf LFS_LDFLAGS) endif +# Xen tools build is currently incompatible with ld --as-needed +COMMA := , +LDFLAGS += $(call cc-option,$(CC),-Wl$(COMMA)--no-as-needed) + # 32-bit x86 does not perform well with -ve segment accesses on Xen. CFLAGS-$(CONFIG_X86_32) += $(call cc-option,$(CC),-mno-tls-direct-seg-refs) CFLAGS += $(CFLAGS-y)
Quoted 22 lines
Quoted 1 line
Quoted 1 line · Ian Campbell
# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1296550939 0
# Node IDa3fb60cc3be3dc6596ed8395e0eb70514bdfcc74# Parent5b6663ba2bb2c54e8fa6745afa16297ebe43328d
tools: disable linker --as-needed option.The Xen build system is not currently compatible with the --as-needed linker option. The proper fix for this is turning out to be rather invasive to the build system so simply disable for now with the intention of revisiting for the 4.2 release.
The $(COMMA) trick allows "," in macro arguments.
Signed-off-by Ian Campbell <[email protected]>Reported/Tested-by: Nathan March <[email protected]>
diff -r
5b6663ba2bb2-ra3fb60cc3be3tools/Rules.mk
tools/Rules.mk LDFLAGS += $(shell getconf LFS_LDFLAGS) · line 60
Quoted 6 lines
tools/Rules.mk +3
-0@@ -55,6 +55,10 @@ LDFLAGS += $(shell getconf LFS_LDFLAGS) LDFLAGS += $(shell getconf LFS_LDFLAGS) endif +# Xen tools build is currently incompatible with ld --as-needed +COMMA := , +LDFLAGS += $(call cc-option,$(CC),-Wl$(COMMA)--no-as-needed)
I don't think this actually works (Did you try with a linker not supporting this option?), as cc-option is implemented passing -S to the compiler (i.e. the linker won't even get invoked).
tools/Rules.mk LDFLAGS += $(shell getconf LFS_LDFLAGS) · line 64
Quoted 4 lines
tools/Rules.mk +1
-0+ # 32-bit x86 does not perform well with -ve segment accesses on Xen. CFLAGS-$(CONFIG_X86_32) += $(call cc-option,$(CC),-mno-tls-direct-seg-refs) CFLAGS += $(CFLAGS-y)
Jan
Quoted 25 lines · Jan Beulich
Quoted 25 lines
Quoted 1 line
Quoted 1 line · Ian Campbell
# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1296550939 0
# Node IDa3fb60cc3be3dc6596ed8395e0eb70514bdfcc74# Parent5b6663ba2bb2c54e8fa6745afa16297ebe43328d
tools: disable linker --as-needed option.The Xen build system is not currently compatible with the --as-needed linker option. The proper fix for this is turning out to be rather invasive to the build system so simply disable for now with the intention of revisiting for the 4.2 release.
The $(COMMA) trick allows "," in macro arguments.
Signed-off-by Ian Campbell <[email protected]>Reported/Tested-by: Nathan March <[email protected]>
diff -r
5b6663ba2bb2-ra3fb60cc3be3tools/Rules.mktools/Rules.mk +0
-0@@ -55,6 +55,10 @@ LDFLAGS += $(shell getconf LFS_LDFLAGS) LDFLAGS += $(shell getconf LFS_LDFLAGS) endif
Quoted 7 lines
tools/Rules.mk LDFLAGS += $(shell getconf LFS_LDFLAGS) · line 60
Quoted 3 lines
tools/Rules.mk +3
-0+# Xen tools build is currently incompatible with ld --as-needed +COMMA := , +LDFLAGS += $(call cc-option,$(CC),-Wl$(COMMA)--no-as-needed)I don't think this actually works (Did you try with a linker not supporting this option?), as cc-option is implemented passing -S to the compiler (i.e. the linker won't even get invoked).
Er, no. I think you are probably right, I only tested with a linker which has the option defaulting to off and Nathan tested the default on case but noone actually tested the not available option.
Any idea how we can sensibly do this test? I'm not even sure when --{no-,}as-needed came along, perhaps we don't actually need to worry?
Ian.
Quoted 35 lines
Quoted 1 line
Quoted 1 line · Ian Campbell
Quoted 25 lines · Jan Beulich
Quoted 25 lines
Quoted 1 line
Quoted 1 line · Ian Campbell
# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1296550939 0
# Node IDa3fb60cc3be3dc6596ed8395e0eb70514bdfcc74# Parent5b6663ba2bb2c54e8fa6745afa16297ebe43328d
tools: disable linker --as-needed option.The Xen build system is not currently compatible with the --as-needed linker option. The proper fix for this is turning out to be rather invasive to the build system so simply disable for now with the intention of revisiting for the 4.2 release.
The $(COMMA) trick allows "," in macro arguments.
Signed-off-by Ian Campbell <[email protected]>Reported/Tested-by: Nathan March <[email protected]>
diff -r
5b6663ba2bb2-ra3fb60cc3be3tools/Rules.mktools/Rules.mk +0
-0@@ -55,6 +55,10 @@ LDFLAGS += $(shell getconf LFS_LDFLAGS) LDFLAGS += $(shell getconf LFS_LDFLAGS) endifQuoted 7 lines
tools/Rules.mk LDFLAGS += $(shell getconf LFS_LDFLAGS) · line 60
Quoted 3 lines
tools/Rules.mk +3
-0+# Xen tools build is currently incompatible with ld --as-needed +COMMA := , +LDFLAGS += $(call cc-option,$(CC),-Wl$(COMMA)--no-as-needed)I don't think this actually works (Did you try with a linker not supporting this option?), as cc-option is implemented passing -S to the compiler (i.e. the linker won't even get invoked).
Quoted 5 lines
Er, no. I think you are probably right, I only tested with a linker which has the option defaulting to off and Nathan tested the default on case but noone actually tested the not available option.
Any idea how we can sensibly do this test?
No, not really (other than changing cc-option).
Quoted 2 lines
I'm not even sure when
--{no-,}as-needed came along, perhaps we don't actually need to worry?
2.15 has it (released in May 2004), 2.13.2 didn't. I don't have a 2.14 sitting around.
Jan
Quoted 6 lines · Jan Beulich
Quoted 3 lines
Quoted 1 line
Quoted 1 line · Ian Campbell
I'm not even sure when
--{no-,}as-needed came along, perhaps we don't actually need to worry?2.15 has it (released in May 2004), 2.13.2 didn't. I don't have a 2.14 sitting around.
Thanks.
My usual measure for this stuff is Debian. It seems Debian Lenny (current stable, just about) has 2.18, Etch (previous stable) has 2.17 and Sarge (one before that) has 2.15. I think we can simply make the use of this option unconditional.
Ian.
# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1296555650 0
# Node ID e4c9925852a021a3ccdc769f04fdaa99b05cffa0 # Parent 5b6663ba2bb2c54e8fa6745afa16297ebe43328d
tools: disable linker --as-needed option.
The Xen build system is not currently compatible with the --as-needed linker option. The proper fix for this is turning out to be rather invasive to the build system so simply disable for now with the intention of revisiting for the 4.2 release.
The --no-as-needed option is available at least since binutils 2.15 (released in May 2004) and hence I think can be unconditionally relied on.
Reported/Tested-by: Nathan March <[email protected]>
tools/Rules.mk +3 -0
@@ -55,6 +55,9 @@ LDFLAGS += $(shell getconf LFS_LDFLAGS) LDFLAGS += $(shell getconf LFS_LDFLAGS) endif +# Xen tools build is currently incompatible with ld --as-needed +LDFLAGS += -Wl,--no-as-needed + # 32-bit x86 does not perform well with -ve segment accesses on Xen. CFLAGS-$(CONFIG_X86_32) += $(call cc-option,$(CC),-mno-tls-direct-seg-refs) CFLAGS += $(CFLAGS-y)
Ian Campbell writes ("Re: [Xen-devel] [PATCH] tools: disable linker --as-needed option"):
Quoted 4 lines
My usual measure for this stuff is Debian. It seems Debian Lenny (current stable, just about) has 2.18, Etch (previous stable) has 2.17 and Sarge (one before that) has 2.15. I think we can simply make the use of this option unconditional.
Right, thanks, applied.
Ian.