[llvm-bugs] [Bug 45670] New: Linking wine 32-bit binaries fails

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Apr 25 13:57:30 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=45670

            Bug ID: 45670
           Summary: Linking wine 32-bit binaries fails
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: COFF
          Assignee: unassignedbugs at nondot.org
          Reporter: orgads at gmail.com
                CC: llvm-bugs at lists.llvm.org

In /usr/bin:
ln -sf ld.lld ld
(Here I used a script that outputs the flags before executing)

In wine build directory:
mkdir test
cd test
echo 'int wmain() {}' > test.c

../tools/winegcc/winegcc -v -save-temps --wine-objdir .. -m32 -fno-PIC
-fasynchronous-unwind-tables -mconsole -municode -mno-cygwin test.c

/usr/bin/gcc -m32 -fno-PIC -c -o test-hAIw1D.o -save-temps -fno-PIC
-fasynchronous-unwind-tables test.c

../tools/winebuild/winebuild -v --save-temps -fasynchronous-unwind-tables
"--cc-cmd=/usr/bin/gcc -m32" --ld-cmd=/usr/bin/ld -m32 -D_REENTRANT --exe -o
a.out-4B52c7.spec.o -F a.out --subsystem console --entry __wine_spec_exe_wentry
-L../dlls -L../libs/wine -- test-hAIw1D.o ../dlls/winecrt0/libwinecrt0.a
../dlls/msvcrt/libmsvcrt.a ../dlls/kernel32/libkernel32.def
../dlls/ntdll/libntdll.def
/usr/bin/gcc -m32 -xassembler -c -m32 -o a.2BcJJ5.o a.YRlrYC.s
/usr/bin/ld -m elf_i386 -r -o a.cZrasB.o a.2BcJJ5.o test-hAIw1D.o
../dlls/winecrt0/libwinecrt0.a ../dlls/msvcrt/libmsvcrt.a
ld.lld -m elf_i386 -r -o a.cZrasB.o a.2BcJJ5.o test-hAIw1D.o
../dlls/winecrt0/libwinecrt0.a ../dlls/msvcrt/libmsvcrt.a
/usr/bin/nm -u a.cZrasB.o
/usr/bin/gcc -m32 -xassembler -c -m32 -o a.out-4B52c7.spec.o a.Ocbvm8.s
Creating file try_link-5wRn6H.c
/usr/bin/gcc -m32 -m32 -o try_link-aAe0Zi.out -Wl,-z,max-page-size=0x1000
try_link-5wRn6H.c
Creating file try_link-6M3xBx.c
ld.lld -plugin /usr/lib/gcc/x86_64-linux-gnu/9/liblto_plugin.so
-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
-plugin-opt=-fresolution=/tmp/ccnUfjaP.res -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id
--eh-frame-hdr -m elf_i386 --hash-style=gnu --as-needed -shared -o a.out.so
/usr/lib/gcc/x86_64-linux-gnu/9/../../../i386-linux-gnu/crti.o
/usr/lib/gcc/x86_64-linux-gnu/9/32/crtbeginS.o -L../dlls -L../libs/wine
-L/usr/lib/gcc/x86_64-linux-gnu/9/32
-L/usr/lib/gcc/x86_64-linux-gnu/9/../../../i386-linux-gnu
-L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib32 -L/lib/i386-linux-gnu
-L/lib/../lib32 -L/usr/lib/i386-linux-gnu -L/usr/lib/../lib32
-L/usr/lib/gcc/x86_64-linux-gnu/9
-L/usr/lib/gcc/x86_64-linux-gnu/9/../../../i386-linux-gnu
-L/usr/lib/gcc/x86_64-linux-gnu/9/../../.. -L/lib/i386-linux-gnu
-L/usr/lib/i386-linux-gnu -Bsymbolic -z max-page-size=0x1000 -z defs -init
__wine_spec_init -fini __wine_spec_fini a.out-4B52c7.spec.o test-hAIw1D.o
../dlls/winecrt0/libwinecrt0.a ../dlls/msvcrt/libmsvcrt.a -lwine -lm -lc -lgcc
--push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed
-lgcc_s --pop-state /usr/lib/gcc/x86_64-linux-gnu/9/32/crtendS.o
/usr/lib/gcc/x86_64-linux-gnu/9/../../../i386-linux-gnu/crtn.o
ld.lld: error: can't create dynamic relocation R_386_32 against local symbol in
readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to
allow text relocations in the output
>>> defined in a.out-4B52c7.spec.o
>>> referenced by a.out-4B52c7.spec.o:(__wine_spec_import_thunks)

ld.lld: error: can't create dynamic relocation R_386_32 against local symbol in
readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to
allow text relocations in the output
>>> defined in a.out-4B52c7.spec.o
>>> referenced by a.out-4B52c7.spec.o:(__wine_spec_import_thunks)

ld.lld: error: can't create dynamic relocation R_386_32 against local symbol in
readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to
allow text relocations in the output
>>> defined in a.out-4B52c7.spec.o
>>> referenced by a.out-4B52c7.spec.o:(__wine_spec_import_thunks)

ld.lld: error: can't create dynamic relocation R_386_32 against symbol:
__wine_spec_init_state in readonly segment; recompile object files with -fPIC
or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in ../dlls/winecrt0/libwinecrt0.a(init.o)
>>> referenced by exe_wentry.c:99 (../../../dlls/winecrt0/exe_wentry.c:99)
>>>               exe_wentry.o:(__wine_spec_exe_wentry) in archive ../dlls/winecrt0/libwinecrt0.a

ld.lld: error: can't create dynamic relocation R_386_32 against symbol:
__wine_spec_init_state in readonly segment; recompile object files with -fPIC
or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in ../dlls/winecrt0/libwinecrt0.a(init.o)
>>> referenced by init.c:38 (../../../dlls/winecrt0/init.c:38)
>>>               init.o:(__wine_spec_init) in archive ../dlls/winecrt0/libwinecrt0.a

etc...

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200425/6cb0d494/attachment.html>


More information about the llvm-bugs mailing list