https://bugs.winehq.org/show_bug.cgi?id=51413
Bug ID: 51413 Summary: winegcc 6.12 regression: options with multiple '=' are not handled correctly Product: Wine Version: 6.12 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: tools Assignee: wine-bugs@winehq.org Reporter: slyich@gmail.com Distribution: ---
Gentoo passes -Wl,--defsym=__gentoo_check_ldflags__=0 as LDFLAGS to every linked target as a capary for $LDFLAGS handling. In 6.11 it used to work fine.
6.12 fails the build as:
$ tools/winegcc/winegcc -o dlls/acledit/acledit.dll.so --wine-objdir . -fno-PIC -Wl,-z,notext -fasynchronous-unwind-tables -shared /tmp/portage/app-emulation/wine-vanilla-6.12/work/wine-6.12/dlls/acledit/acledit.spec -mno-cygwin -Wb,--prefer-native dlls/acledit/main.o dlls/ucrtbase/libucrtbase.a -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -Wl,--defsym=__gentoo_check_ldflags__=0
/usr/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../x86_64-pc-linux-gnu/bin/ld:--defsym:0: syntax error collect2: error: ld returned 1 exit status winegcc: /usr/lib/ccache/bin/x86_64-pc-linux-gnu-gcc failed
If I run already installed 6.11 winegcc it works as expected:
$ winegcc -o dlls/acledit/acledit.dll.so --wine-objdir . -fno-PIC -Wl,-z,notext -fasynchronous-unwind-tables -shared /tmp/portage/app-emulation/wine-vanilla-6.12/work/wine-6.12/dlls/acledit/acledit.spec -mno-cygwin -Wb,--prefer-native dlls/acledit/main.o dlls/ucrtbase/libucrtbase.a -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -Wl,--defsym=__gentoo_check_ldflags__=0 -m32 <ok>
$ nm -D dlls/acledit/acledit.dll.so | fgrep gentoo 00000000 A __gentoo_check_ldflags__
I suspect regression cropped up in:
commit fcda0afdd429e11d75dc61f628e40a6c8973ce44 Author: Connor Abbott cwabbott0@gmail.com Date: Fri Jul 2 11:48:01 2021 +0200
winegcc: Support -Wl,foo=... style linker options.
In particular meson uses -Wl,--out-implib=...
Signed-off-by: Connor Abbott cwabbott0@gmail.com Signed-off-by: Alexandre Julliard julliard@winehq.org
diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c index fd2d2c2a794..8c1e0d088ac 100644 --- a/tools/winegcc/winegcc.c +++ b/tools/winegcc/winegcc.c @@ -1982,7 +1982,7 @@ int main(int argc, char **argv) if (strncmp("-Wl,", opts.args->base[i], 4) == 0) { unsigned int j; - strarray* Wl = strarray_fromstring(opts.args->base[i] + 4, ","); + strarray* Wl = strarray_fromstring(opts.args->base[i] + 4, ",="); for (j = 0; j < Wl->size; j++) { if (!strcmp(Wl->base[j], "--image-base") && j < Wl->size - 1)
which might not handle multiple '=' correctly.