[Bug 28050] New: llvm-gcc-4.5 fails to compile loader/preloader.c with optimizations enabled

wine-bugs at winehq.org wine-bugs at winehq.org
Wed Aug 10 18:03:32 CDT 2011


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 at winehq.org
        ReportedBy: austinenglish at gmail.com


austin at 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.



More information about the wine-bugs mailing list