https://bugs.winehq.org/show_bug.cgi?id=42436
Bug ID: 42436 Summary: Wine Wiki: Building Wine - Memory & Address Checkers Product: WineHQ.org Version: unspecified Hardware: x86 OS: Linux Status: NEW Severity: normal Priority: P2 Component: www-unknown Assignee: wine-bugs@winehq.org Reporter: wylda@volny.cz Distribution: ---
I don't know, if anyone tried recently follow wiki link:
https://wiki.winehq.org/Building_Wine#Memory_.26_Address_Checkers
This link mentions "...you only need to pass the -fsanitize=address flag to the compiler when building"
../wine-source/configure CFLAGS="-g -O1 -fsanitize=address -other-flags"
But this fails soon in make_xftmpl.o: In function fatal_error':
..../tools/make_xftmpl.c:116: undefined reference to `__asan_option_detect_stack_use_after_return'
..../tools/make_xftmpl.c:116: undefined reference to `__asan_stack_malloc_1'
Passing LIBS="-lasan" to configure fixes this, but build fails anyway at cca 63%:
..../dlls/ntdll/loader.c:2979: undefined reference to `pthread_sigmask'
Per some gentoo wiki: Some configure scripts test the need of the -lpthread compiler flag by testing whether the function pthread_create() is available without it. The Address Sanitizer library (libasan) provides this function. However it does not have a full pthread implementation, more advanced pthread functions aren't provided. Therefore the compilation fails. A workaround is to add the -lpthread compiler flag manually.
Passing LIBS="-lasan -lpthread" to configure fixes this issue, but anyway fails at the end:
../tools/sfnt2fon/sfnt2fon -o coue1255.fon ../../wine_git_src/fonts/courier.ttf -d 128 13,1255,8
Makefile:174: recipe for target 'coue1255.fon' failed
==16755==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
make[1]: *** [coue1255.fon] Error 1
make: *** [fonts] Error 2
Did anyone tried to follow that Wiki? I tried that on Debian Stretch. Gcc (Debian 6.3.0-6) 6.3.0 20170205
https://bugs.winehq.org/show_bug.cgi?id=42436
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |austinenglish@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=42436
Kyle Auble kyle.auble@zoho.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle.auble@zoho.com
--- Comment #1 from Kyle Auble kyle.auble@zoho.com --- (In reply to Wylda from comment #0)
I don't know, if anyone tried recently follow wiki link:
https://wiki.winehq.org/Building_Wine#Memory_.26_Address_Checkers
This link mentions "...you only need to pass the -fsanitize=address flag to the compiler when building"
../wine-source/configure CFLAGS="-g -O1 -fsanitize=address -other-flags"
But this fails soon in make_xftmpl.o: In function fatal_error':
..../tools/make_xftmpl.c:116: undefined reference to `__asan_option_detect_stack_use_after_return'
..../tools/make_xftmpl.c:116: undefined reference to `__asan_stack_malloc_1'
Passing LIBS="-lasan" to configure fixes this, but build fails anyway at cca 63%:
..../dlls/ntdll/loader.c:2979: undefined reference to `pthread_sigmask'
Passing LIBS="-lasan -lpthread" to configure fixes this issue, but anyway fails at the end:
../tools/sfnt2fon/sfnt2fon -o coue1255.fon ../../wine_git_src/fonts/courier.ttf -d 128 13,1255,8
==16755==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
Did anyone tried to follow that Wiki? I tried that on Debian Stretch. Gcc (Debian 6.3.0-6) 6.3.0 20170205
After looking into this, I think you've made a good catch. The wiki instructions weren't entirely correct. You should only need to use the -fsanitize=address flag, but you need to add it to both CFLAGS and LDFLAGS when you configure: https://stackoverflow.com/questions/37970758/how-to-use-addresssanitizer-in-...
I think that's why you were having the errors you did. The first problem was not having access to ASan's malloc, which you get when you add back in -lasan. Ditto for the second problem and -lpthread. Your final error probably came from still not linking to the full ASan library, just the two pieces you had specified. That you also need to link explicitly to ASan totally slipped by me when I was reading the documentation. I've corrected the wiki page now.
By the way, we can always use more help with documentation, especially fact-checking like this. If you want to edit the wiki, first create a wiki account (single sign-on across WineHQ is still on our wishlist), then you just need to email a wiki admin to ask for edit privileges. I think of all the admins, Rosanne DiMesio is most active on the wiki.
Otherwise, if the new instructions work for you, I think we can close this bug.
https://bugs.winehq.org/show_bug.cgi?id=42436
tokktokk fdsfgs@krutt.org changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |fdsfgs@krutt.org
https://bugs.winehq.org/show_bug.cgi?id=42436
Ken Sharp imwellcushtymelike@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|NEW |RESOLVED
--- Comment #2 from Ken Sharp imwellcushtymelike@gmail.com --- As above
https://bugs.winehq.org/show_bug.cgi?id=42436
Rosanne DiMesio dimesio@earthlink.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #3 from Rosanne DiMesio dimesio@earthlink.net --- Closing fixed website bug.