Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 375729 - dev-libs/klibc-1.5.23 fails with ld.gold: ,noexecstack: unknown -z option
Summary: dev-libs/klibc-1.5.23 fails with ld.gold: ,noexecstack: unknown -z option
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Kernel Miscellaneous
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 356819
  Show dependency tree
 
Reported: 2011-07-20 08:03 UTC by Justin Lecher (RETIRED)
Modified: 2013-03-16 23:12 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
/tmp/einfo (einfo,6.36 KB, text/plain)
2011-07-20 08:04 UTC, Justin Lecher (RETIRED)
Details
/var/log/portage/build/dev-libs/klibc-1.5.23:20110720-075810.log (klibc-1.5.23:20110720-075810.log,715.10 KB, text/plain)
2011-07-20 08:05 UTC, Justin Lecher (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Lecher (RETIRED) gentoo-dev 2011-07-20 08:03:07 UTC
ld -m elf_x86_64 -o usr/kinit/ipconfig/static/ipconfig -z,noexecstack usr/klibc/arch/x86_64/crt0.o --start-group  usr/kinit/ipconfig/main.o usr/kinit/ipconfig/netdev.o usr/kinit/ipconfig/packet.o usr/kinit/ipconfig/dhcp_proto.o usr/kinit/ipconfig/bootp_proto.o  usr/klibc/libc.a /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.1/libgcc.a --end-group ; cp -f usr/kinit/ipconfig/static/ipconfig usr/kinit/ipconfig/static/ipconfig.g ; strip --strip-all -R .comment -R .note --strip-all -R .comment -R .note --strip-all -R .comment -R .note usr/kinit/ipconfig/static/ipconfig
ld: ,noexecstack: unknown -z option
ld: use the --help option for usage information
make[3]: *** [usr/kinit/ipconfig/static/ipconfig] Error 1
make[2]: *** [usr/kinit/ipconfig] Error 2
make[1]: *** [all] Error 2
make: *** [klibc] Error 2
emake failed
 * ERROR: dev-libs/klibc-1.5.23 failed (compile phase):
 *   Compile failed!




$ einfo =dev-libs/klibc-1.5.23
sh: einfo: command not found
Comment 1 Justin Lecher (RETIRED) gentoo-dev 2011-07-20 08:04:30 UTC
Created attachment 280433 [details]
/tmp/einfo

emerge --info
Comment 2 Justin Lecher (RETIRED) gentoo-dev 2011-07-20 08:05:03 UTC
Created attachment 280435 [details]
/var/log/portage/build/dev-libs/klibc-1.5.23:20110720-075810.log

build.log
Comment 3 Mike Pagano gentoo-dev 2011-11-02 16:00:16 UTC
I can seem to reproduce this withh gcc-4.6.2. Is this still an issue for you with that compiler?
Comment 4 Justin Lecher (RETIRED) gentoo-dev 2011-11-02 16:14:59 UTC
same with latest gcc:4.6 binutils and klibc.
Comment 5 Mike Pagano gentoo-dev 2011-11-05 19:16:23 UTC
I'm not sure why mine would work, and yours would not.

Same klibc
Same binutils
Same arch


rm -f usr/kinit/ipconfig/lib.a; ar cru usr/kinit/ipconfig/lib.a usr/kinit/ipconfig/main.o usr/kinit/ipconfig/netdev.o usr/kinit/ipconfig/packet.o usr/kinit/ipconfig/dhcp_proto.o usr/kinit/ipconfig/bootp_proto.o
  ld -m elf_x86_64 -o usr/kinit/ipconfig/static/ipconfig -z,noexecstack usr/klibc/arch/x86_64/crt0.o --start-group  usr/kinit/ipconfig/main.o usr/kinit/ipconfig/netdev.o usr/kinit/ipconfig/packet.o usr/kinit/ipconfig/dhcp_proto.o usr/kinit/ipconfig/bootp_proto.o  usr/klibc/libc.a /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libgcc.a --end-group ; cp -f usr/kinit/ipconfig/static/ipconfig usr/kinit/ipconfig/static/ipconfig.g ; strip --strip-all -R .comment -R .note --strip-all -R .comment -R .note --strip-all -R .comment -R .note usr/kinit/ipconfig/static/ipconfig
  ld -m elf_x86_64 -o usr/kinit/ipconfig/shared/ipconfig -z,noexecstack -e main usr/klibc/interp.o --start-group  usr/kinit/ipconfig/main.o usr/kinit/ipconfig/netdev.o usr/kinit/ipconfig/packet.o usr/kinit/ipconfig/dhcp_proto.o usr/kinit/ipconfig/bootp_proto.o  -R usr/klibc/libc.so /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libgcc.a --end-group ; cp -f usr/kinit/ipconfig/shared/ipconfig usr/kinit/ipconfig/shared/ipconfig.g ; strip --strip-all -R .comment -R .note --strip-all -R .comment -R .note --strip-all -R .comment -R .note usr/kinit/ipconfig/shared/ipconfig
   rm -f usr/kinit/fstype/lib.a; ar cru usr/kinit/fstype/lib.a usr/kinit/fstype/main.o usr/kinit/fstype/fstype.o
Comment 6 Tim Harder gentoo-dev 2011-11-08 04:54:08 UTC
(In reply to comment #5)
> I'm not sure why mine would work, and yours would not.

Are you using the gold linker as mentioned in the summary? I can reproduce this using it.
Comment 7 Mike Pagano gentoo-dev 2012-03-22 23:42:37 UTC
Not sure gold linker can compile klibc. toolchain, any thoughts?
Comment 8 Justin Lecher (RETIRED) gentoo-dev 2012-03-23 07:42:39 UTC
gold doesn't except -z,noexecstack, it needs to be -Wl,-z,noexecstack.
Comment 9 SpanKY gentoo-dev 2012-03-24 06:37:51 UTC
(In reply to comment #8)

not quite.  the compiler driver accepts -Wl,-z,noexecstack.  when invoking the linker, you have to drop the comma:
  ld ... -z noexecstack ...

atm your invocation is doing:
  ld ... -z,noexecstack ...

hence the error:
  ld: ,noexecstack: unknown -z option

because it's treating ",noexecstack" as the option.

the ebuild is clearly broken:
klibc-1.5.25.ebuild:            EXTRA_KLIBCLDFLAGS="-z,noexecstack" \
Comment 10 Mike Pagano gentoo-dev 2013-03-16 23:12:34 UTC
Fixed in >= 1.5.25