-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[MC] Invalid GOTOFF relocation in shared library objects #10065
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks. A .ii should be good, a .s even better (assuming the problem is in the integrated assembler). |
assembly file |
Did some more testing, does not occur at -O0, but does occur at -O1 and -O2. This is the case in 2.9 and in trunk (r130866). Furthermore, occurs with or without the integrated assembler. I'll attach a preprocessed C file. |
preprocessed clang file |
preprocessed gcc file |
I was able to trigger the bug with just:#include <math.h> double foo(double x) ======= though I haven't quite been able to get a testcase that doesn't depend on Wine yet. It's optimization related, doesn't occur at -O0, but does at -O1, but I haven't yet found a list of what -O1 enables to narrow it down.. |
We are seeing the same here on FreeBSD with several ports, but typically After some experimentation, I ended up with exactly the same wrapper as
E.g. using a "high" CPU: clang -cc1 -triple i386-unknown-freebsd9.0 -S -pic-level 2 -target-cpu results in: foo: whereas using a "lower" CPU: clang -cc1 -triple i386-unknown-freebsd9.0 -S -pic-level 2 -target-cpu results in: foo: The former command line later leads to a linking error "relocation Apparently the tail-call optimization is triggered when using "high" |
r137292. |
clang version 3.0 (trunk 137293) works for wine at -O1/-O2 :) |
…23-f62f13d5db21 [🍒 stable/20240723] [lldb] Store the return SBValueList in the CommandReturnObject (llvm#127566)
Extended Description
On freenode#winehackers, Austin English reported the following while building Wine with latest trunk LLVM/Clang:
austin@aw21 ~/src/wine-clang/dlls/msvcrt $ make
../../tools/winegcc/winegcc -B../../tools/winebuild --sysroot=../.. -fasynchronous-unwind-tables -shared ./msvcrt.spec console.o cpp.o cppexcept.o ctype.o data.o dir.o environ.o errno.o except.o exit.o file.o heap.o locale.o lock.o main.o math.o mbcs.o misc.o process.o scanf.o string.o thread.o time.o undname.o wcs.o rsrc.res -o msvcrt.dll.so -ladvapi32 -luser32 -Wb,-dadvapi32 -Wb,-duser32 ../../libs/port/libwine_port.a
/usr/lib/gcc/i686-pc-linux-gnu/4.4.5/../../../../i686-pc-linux-gnu/bin/ld: math.o: relocation R_386_GOTOFF against undefined symbol `cos@@GLIBC_2.0' can not be used when making a shared object
/usr/lib/gcc/i686-pc-linux-gnu/4.4.5/../../../../i686-pc-linux-gnu/bin/ld: final link failed: Bad value
clang: error: linker command failed with exit code 1 (use -v to see invocation)
winegcc: clang failed
make: *** [msvcrt.dll.so] Error 2
Looks like the ELF writer is generating GOTOFF relocations when it shouldn't be (i.e. in PIC objects).
I'll try to get him to reduce this to something you can use.
The text was updated successfully, but these errors were encountered: