[Bug 28050] New: llvm-gcc-4.5 fails to compile loader/preloader.c with optimizations enabled
http://bugs.winehq.org/show_bug.cgi?id=28050 Summary: llvm-gcc-4.5 fails to compile loader/preloader.c with optimizations enabled Product: Wine Version: 1.3.26 Platform: x86 URL: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=63718 2 OS/Version: Linux Status: NEW Keywords: download, source Severity: blocker Priority: P2 Component: loader AssignedTo: wine-bugs(a)winehq.org ReportedBy: austinenglish(a)gmail.com austin(a)debian:~/wine-git/loader$ make llvm-gcc -o wine-preloader -static -nostartfiles -nodefaultlibs -Wl,-Ttext=0x7c400000 preloader.o ../libs/port/libwine_port.a preloader.o: In function `set_process_name': /home/austin/wine-git/loader//preloader.c:455: undefined reference to `memset' preloader.o: In function `map_so_lib': /home/austin/wine-git/loader//preloader.c:455: undefined reference to `memset' collect2: ld returned 1 exit status make: *** [wine-preloader] Error 1 make -k lets it compile and wine runs. Alternatively, you can disable optimization in loader/Makefile, and it will compile. I tried a simple patch: diff --git a/loader/preloader.c b/loader/preloader.c index a94c52c..2e55d2a 100644 --- a/loader/preloader.c +++ b/loader/preloader.c @@ -173,6 +173,9 @@ void *__stack_chk_guard = 0; void __stack_chk_fail_local(void) { return; } void __stack_chk_fail(void) { return; } +/* for dragonegg */ +void *memset(void *s, int c, size_t n) { return s; } + #ifdef __i386__ /* data for setting up the glibc-style thread-local storage in %gs */ but then wine segfaults :/. Additionally, using a simple implementation: (from http://clc-wiki.net/wiki/C_standard_library:string.h:memset) void *memset(void *s, int c, size_t n) { unsigned char* p=s; while(n--) *p++ = (unsigned char)c; return s; } fails in the same way. This is the only failure with llvm-gcc-4.5 (aka dragonegg), after that, at least noteapd runs. Haven't checked what tests fail yet though :).. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=28050 Duncan Sands <baldrick(a)free.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |baldrick(a)free.fr --- Comment #1 from Duncan Sands <baldrick(a)free.fr> 2011-08-11 02:04:08 CDT --- This is probably due to LLVM synthesizing a call to memset. Normally this should be disabled by compiling with -fno-builtin, but unfortunately dragonegg does not currently respect this flag. I suggest you open a bug report against dragonegg asking for -fno-builtin to be respected. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=28050 Dmitry Timoshkov <dmitry(a)baikal.ru> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|loader |-unknown Severity|blocker |minor --- Comment #2 from Dmitry Timoshkov <dmitry(a)baikal.ru> 2011-08-11 02:23:24 CDT --- Most likely not a Wine bug -> Invalid. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=28050 --- Comment #3 from Duncan Sands <baldrick(a)free.fr> 2011-08-11 08:26:59 CDT --- Well, loader/preloader.c isn't compiled with -fno-builtins (wine version 1.27). Thus it is OK for the compiler to synthesize a call to memset in it. So if wine requires that there be no such calls, then it is a wine bug that -fno-builtins was not used. Of course, -fno-builtins won't help until dragonegg is fixed to pay attention to it. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=28050 --- Comment #4 from Austin English <austinenglish(a)gmail.com> 2011-10-18 14:27:36 CDT --- (In reply to comment #3)
Well, loader/preloader.c isn't compiled with -fno-builtins (wine version 1.27). Thus it is OK for the compiler to synthesize a call to memset in it. So if wine requires that there be no such calls, then it is a wine bug that -fno-builtins was not used.
Of course, -fno-builtins won't help until dragonegg is fixed to pay attention to it.
http://llvm.org/bugs/show_bug.cgi?id=11172 http://llvm.org/bugs/show_bug.cgi?id=11173 -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=28050 Jeff Cook <jeff(a)deseret-tech.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jeff(a)deseret-tech.com --- Comment #5 from Jeff Cook <jeff(a)deseret-tech.com> 2013-05-03 21:00:25 CDT --- The memset issue described in the original post occurs when compiling on mainline gcc 4.8 with -03. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=28050 --- Comment #6 from Duncan Sands <baldrick(a)free.fr> 2013-05-04 02:22:32 CDT --- Has the wine build been fixed to compile loader/preloader.c with -fno-builtins ? -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=28050 Austin English <austinenglish(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |UPSTREAM --- Comment #7 from Austin English <austinenglish(a)gmail.com> 2013-05-06 17:29:02 CDT --- (In reply to comment #6)
Has the wine build been fixed to compile loader/preloader.c with -fno-builtins ?
With dragonegg from svn, wine builds fine, but crashes on start: austin(a)aw25 ~/src/wine-dragonegg $ ./wine notepad err:seh:raise_exception Unhandled exception code c0000005 flags 0 addr 0x7bc71be8 err:seh:raise_exception Unhandled exception code c0000005 flags 0 addr 0x7bc71be8 That should be a separate bug, of course. For reference, this was with gcc-4.6.3: gcc-4.6.3 -fplugin=/home/austin/src/dragonegg/dragonegg.so -m32 -c -I. -I. -I../include -I../include -D__WINESRC__ -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body -Wignored-qualifiers -Wstrict-prototypes -Wtype-limits -Wunused-but-set-parameter -Wwrite-strings -gdwarf-2 -gstrict-dwarf -fno-omit-frame-pointer -Wpointer-arith -Wlogical-op -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -fno-builtin -o main.o main.c -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=28050 Austin English <austinenglish(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #8 from Austin English <austinenglish(a)gmail.com> 2013-05-06 17:29:13 CDT --- Fixed UPSTREAM. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=28050 Gabriel Ravier <gabravier(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |gabravier(a)gmail.com -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (2)
-
wine-bugs@winehq.org -
WineHQ Bugzilla