https://bugs.winehq.org/show_bug.cgi?id=53392
Bug ID: 53392 Summary: does not compile on Openindiana (solaris11) Product: Wine Version: 7.13 Hardware: x86-64 OS: Solaris Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: malicorne@chez.com
It seems that wine does not respect the CFLAGS or at least to some extend.
$ uname -a SunOS addie 5.11 illumos-c1bbf9203b i86pc i386 i86pc illumos
$ ./configure CFLAGS="-fPIC" CXXFLAGS="-fPIC" --prefix=/opt/wine
$ make [...] gcc -o tools/winegcc/winegcc tools/winegcc/utils.o tools/winegcc/winegcc.o -lsocket -lnsl tools/winegcc/winegcc -o dlls/acledit/acledit.dll.so --wine-objdir . -fno-PIC -fasynchronous-unwind-tables -shared \ dlls/acledit/acledit.spec -Wb,--prefer-native -mno-cygwin dlls/acledit/main.o \ dlls/winecrt0/libwinecrt0.a dlls/ucrtbase/libucrtbase.a dlls/kernel32/libkernel32.a \ dlls/ntdll/libntdll.a Text relocation remains referenced against symbol offset in file .rodata (section) 0x11010 acledit.dll-62d91a2e.spec.o .rodata (section) 0x11017 acledit.dll-62d91a2e.spec.o .rodata (section) 0x11030 acledit.dll-62d91a2e.spec.o .rodata (section) 0x11037 acledit.dll-62d91a2e.spec.o .rodata (section) 0x11050 acledit.dll-62d91a2e.spec.o .rodata (section) 0x11057 acledit.dll-62d91a2e.spec.o .rodata (section) 0x11070 acledit.dll-62d91a2e.spec.o .rodata (section) 0x11077 acledit.dll-62d91a2e.spec.o .rodata (section) 0x11090 acledit.dll-62d91a2e.spec.o .rodata (section) 0x11097 acledit.dll-62d91a2e.spec.o .rodata (section) 0x110b0 acledit.dll-62d91a2e.spec.o .rodata (section) 0x110b7 acledit.dll-62d91a2e.spec.o .data (section) 0x110d5 acledit.dll-62d91a2e.spec.o .data (section) 0x110f1 acledit.dll-62d91a2e.spec.o .data (section) 0x11102 acledit.dll-62d91a2e.spec.o .data (section) 0x1110a acledit.dll-62d91a2e.spec.o .data (section) 0x11112 acledit.dll-62d91a2e.spec.o .data (section) 0x1111a acledit.dll-62d91a2e.spec.o .data (section) 0x11122 acledit.dll-62d91a2e.spec.o ld: fatal: relocations remain against allocatable but non-writable sections collect2: error: ld returned 1 exit status winegcc: /usr/bin/gcc failed make: *** [Makefile:1380: dlls/acledit/acledit.dll.so] Error 2 Error on line 4
If I replace the -fno-PIC by -fPIC as requested on CFLAGS, it does go on until next time.
https://bugs.winehq.org/show_bug.cgi?id=53392
Zeb Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |z.figura12@gmail.com
--- Comment #1 from Zeb Figura z.figura12@gmail.com --- We intentionally compile with -fno-PIC on i386; Windows programs require it. See bug 45199.
https://bugs.winehq.org/show_bug.cgi?id=53392
--- Comment #2 from Zeb Figura z.figura12@gmail.com --- (In reply to Zeb Figura from comment #1)
We intentionally compile with -fno-PIC on i386; Windows programs require it. See bug 45199.
Eh, https://source.winehq.org/git/wine.git/commit/8f732c66ab37b54c30d63c74f7822ba1d4f04996 is probably a better explanation.
https://bugs.winehq.org/show_bug.cgi?id=53392
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |austinenglish@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=53392
--- Comment #3 from malic malicorne@chez.com --- (In reply to Zeb Figura from comment #2)
(In reply to Zeb Figura from comment #1)
We intentionally compile with -fno-PIC on i386; Windows programs require it. See bug 45199.
Eh, https://source.winehq.org/git/wine.git/commit/ 8f732c66ab37b54c30d63c74f7822ba1d4f04996 is probably a better explanation.
I understand. What are my options there apart from digging and removing all the fno-PIC ? Is the behaviour supposed to be the same for x64 ?
https://bugs.winehq.org/show_bug.cgi?id=53392
--- Comment #4 from Zeb Figura z.figura12@gmail.com --- (In reply to malic from comment #3)
I understand. What are my options there apart from digging and removing all the fno-PIC ?
Is there a reason you need -fPIC? As stated, Windows programs really do need -fno-PIC, so the ideal solution would be to compile with -fno-PIC.
Is the behaviour supposed to be the same for x64 ?
We use -fPIC on all architectures other than i386.
https://bugs.winehq.org/show_bug.cgi?id=53392
--- Comment #5 from malic malicorne@chez.com --- (In reply to Zeb Figura from comment #4)
(In reply to malic from comment #3)
I understand. What are my options there apart from digging and removing all the fno-PIC ?
Is there a reason you need -fPIC? As stated, Windows programs really do need -fno-PIC, so the ideal solution would be to compile with -fno-PIC.
The reason I need -fPIC is on the description of the "bug" : ld: fatal: relocations remain against allocatable but non-writable sections Which is worked around or fixed by using -fPIC
Is the behaviour supposed to be the same for x64 ?
We use -fPIC on all architectures other than i386.
So compiling with -m64 should do the trick ? I guess nowadays we should not even think about compiling without -m64
https://bugs.winehq.org/show_bug.cgi?id=53392
--- Comment #6 from Zeb Figura z.figura12@gmail.com --- Created attachment 72805 --> https://bugs.winehq.org/attachment.cgi?id=72805 use -mimpure-text
Well, you could omit the 32-bit parts of Wine, but what you end up with will not be useful for most Windows programs.
A quick Internet search suggests that we need -mimpure-text. The attached patch should use it if available (it may need you to rerun autoreconf, though).
https://bugs.winehq.org/show_bug.cgi?id=53392
--- Comment #7 from malic malicorne@chez.com --- the -mimpure-text is not enough :
[...] gcc -o tools/winegcc/winegcc tools/winegcc/utils.o tools/winegcc/winegcc.o -lsocket -lnsl tools/winegcc/winegcc -o dlls/acledit/acledit.dll.so --wine-objdir . -fno-PIC -mimpure-text -fasynchronous-unwind-tables \ -shared dlls/acledit/acledit.spec -Wb,--prefer-native -mno-cygwin dlls/acledit/main.o \ dlls/winecrt0/libwinecrt0.a dlls/ucrtbase/libucrtbase.a dlls/kernel32/libkernel32.a \ dlls/ntdll/libntdll.a Text relocation remains referenced against symbol offset in file .rodata (section) 0x11010 acledit.dll-62dfa53a.spec.o .rodata (section) 0x11017 acledit.dll-62dfa53a.spec.o .rodata (section) 0x11030 acledit.dll-62dfa53a.spec.o .rodata (section) 0x11037 acledit.dll-62dfa53a.spec.o .rodata (section) 0x11050 acledit.dll-62dfa53a.spec.o .rodata (section) 0x11057 acledit.dll-62dfa53a.spec.o .rodata (section) 0x11070 acledit.dll-62dfa53a.spec.o .rodata (section) 0x11077 acledit.dll-62dfa53a.spec.o .rodata (section) 0x11090 acledit.dll-62dfa53a.spec.o .rodata (section) 0x11097 acledit.dll-62dfa53a.spec.o .rodata (section) 0x110b0 acledit.dll-62dfa53a.spec.o .rodata (section) 0x110b7 acledit.dll-62dfa53a.spec.o .data (section) 0x110d5 acledit.dll-62dfa53a.spec.o .data (section) 0x110f1 acledit.dll-62dfa53a.spec.o .data (section) 0x11102 acledit.dll-62dfa53a.spec.o .data (section) 0x1110a acledit.dll-62dfa53a.spec.o .data (section) 0x11112 acledit.dll-62dfa53a.spec.o .data (section) 0x1111a acledit.dll-62dfa53a.spec.o .data (section) 0x11122 acledit.dll-62dfa53a.spec.o .rodata (section) 0xc dlls/acledit/main.o .data (section) 0x11 dlls/acledit/main.o .rodata.str1.1 (merged string section) 0x36 dlls/acledit/main.o .data (section) 0x73 dlls/acledit/main.o .rodata.str1.1 (merged string section) 0x8c dlls/acledit/main.o .rodata (section) 0x91 dlls/acledit/main.o .data (section) 0x96 dlls/acledit/main.o ld: fatal: relocations remain against allocatable but non-writable sections collect2: error: ld returned 1 exit status winegcc: /usr/bin/gcc failed make: *** [Makefile:1380: dlls/acledit/acledit.dll.so] Error 2 Error on line 759
https://bugs.winehq.org/show_bug.cgi?id=53392
Zeb Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #72805|0 |1 is obsolete| |
--- Comment #8 from Zeb Figura z.figura12@gmail.com --- Created attachment 72807 --> https://bugs.winehq.org/attachment.cgi?id=72807 use -mimpure-text (try 2)
Sorry, I missed a spot. Can you please try the attached patch?
https://bugs.winehq.org/show_bug.cgi?id=53392
--- Comment #9 from malic malicorne@chez.com --- Created attachment 72809 --> https://bugs.winehq.org/attachment.cgi?id=72809 Configure output
Configure output with the last patch tentative
https://bugs.winehq.org/show_bug.cgi?id=53392
--- Comment #10 from malic malicorne@chez.com --- Created attachment 72810 --> https://bugs.winehq.org/attachment.cgi?id=72810 Make output
Make output with patch from comment #8
https://bugs.winehq.org/show_bug.cgi?id=53392
--- Comment #11 from Zeb Figura z.figura12@gmail.com --- Sorry, I should have clarified; you'll still need to run autoreconf.
https://bugs.winehq.org/show_bug.cgi?id=53392
--- Comment #12 from malic malicorne@chez.com --- Ok, now I made good progress, I am back to the regular platform wierdness (like TIOCGWINSZ is defined in sys/termios.h not sys/ioctl.h), I will try to go through and build a set of patches.
Just a side note, your patch from commment #8 is not good for 7.13, I just applied the changes manually, I assumed you made it against master on git.
I think we can close this one if you want, I will reopen one if I see a
https://bugs.winehq.org/show_bug.cgi?id=53392
--- Comment #13 from Zeb Figura z.figura12@gmail.com --- (In reply to malic from comment #12)
Ok, now I made good progress, I am back to the regular platform wierdness (like TIOCGWINSZ is defined in sys/termios.h not sys/ioctl.h), I will try to go through and build a set of patches.
Just a side note, your patch from commment #8 is not good for 7.13, I just applied the changes manually, I assumed you made it against master on git.
Yes, it was made against master, sorry about that.
I'll submit that patch upstream; thanks for testing.
I think we can close this one if you want, I will reopen one if I see a
It can be closed once the patches are upstream and released.
https://bugs.winehq.org/show_bug.cgi?id=53392
--- Comment #14 from Zeb Figura z.figura12@gmail.com --- I don't think -mimpure-text is going to make it upstream. Rather, we'll need a way to compile with mingw-w64 for Solaris.