[Bug ld/32950] --as-needed breaks linking

2025-05-09 Thread stsp at users dot sourceforge.net
https://sourceware.org/bugzilla/show_bug.cgi?id=32950 --- Comment #10 from Stas Sergeev --- Hmm, seems it has --libs-only-l and --libs-only-other, so that works too. Thanks! -- You are receiving this mail because: You are on the CC list for the bug.

[Bug ld/32950] --as-needed breaks linking

2025-05-09 Thread stsp at users dot sourceforge.net
https://sourceware.org/bugzilla/show_bug.cgi?id=32950 --- Comment #9 from Stas Sergeev --- To clarify: I used to do LDFLAGS=`pkg-config --libs` because I though LDFLAGS supports both things. `pkg-config --libs` gives lots of ldflags, plus -lXX stuff. If we are to split this, it would be good if p

[Bug ld/32950] --as-needed breaks linking

2025-05-09 Thread stsp at users dot sourceforge.net
https://sourceware.org/bugzilla/show_bug.cgi?id=32950 --- Comment #8 from Stas Sergeev --- Thanks, that seems to work. Unfortunately pkg-config doesn't have `--ldflags`, which is why I haven't done that initially. This is minor and can be ignored, but maybe you have the plans to add --ldflags to

[Bug ld/32950] --as-needed breaks linking

2025-05-09 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=32950 --- Comment #7 from Sam James --- Thanks, this makes more sense now. Passing libraries in LDFLAGS is discouraged for exactly this reason. One is supposed to use LIBS or similar instead. -- You are receiving this mail because: You are on the

[Bug ld/32950] --as-needed breaks linking

2025-05-09 Thread stsp at users dot sourceforge.net
https://sourceware.org/bugzilla/show_bug.cgi?id=32950 --- Comment #6 from Stas Sergeev --- So in my case I am providing (via LDFLAGS) a lib with an alternate implementation of the function checked with AC_CHECK_FUNC. This works with ld.lld, but fails with GNU ld, as configure then can't link it (

[Bug ld/32950] --as-needed breaks linking

2025-05-09 Thread stsp at users dot sourceforge.net
https://sourceware.org/bugzilla/show_bug.cgi?id=32950 --- Comment #5 from Stas Sergeev --- The problem is not in a makefile, but in autotools itself. Consider this example performed on a plain "ncurses" source tree: LDFLAGS="-Wl,--as-needed -lgcc" ./configure configure passes because -lgcc is

[Bug ld/32950] --as-needed breaks linking

2025-05-09 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=32950 --- Comment #4 from Sam James --- (In reply to Stas Sergeev from comment #2) > But I can't even change the link > order: configure puts LDFLAGS before > conftest.c, so all configure tests > start to fail when --as-needed is > added to LDFLAGS.

[Bug ld/32950] --as-needed breaks linking

2025-05-09 Thread stsp at users dot sourceforge.net
https://sourceware.org/bugzilla/show_bug.cgi?id=32950 --- Comment #3 from Stas Sergeev --- Maybe gcc, when compiling directly from .c file, should put the intermediate object at the beginning of the linker cmdline? -- You are receiving this mail because: You are on the CC list for the bug.

[Bug ld/32950] --as-needed breaks linking

2025-05-09 Thread stsp at users dot sourceforge.net
https://sourceware.org/bugzilla/show_bug.cgi?id=32950 --- Comment #2 from Stas Sergeev --- But I can't even change the link order: configure puts LDFLAGS before conftest.c, so all configure tests start to fail when --as-needed is added to LDFLAGS. What would you suggest as a fix then? -- You a

[Bug ld/32950] --as-needed breaks linking

2025-05-09 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=32950 Sam James changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---