http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55599



             Bug #: 55599

           Summary: switch from mach_override to mac interpose function

                    support in libasan broke -static-libasan

    Classification: Unclassified

           Product: gcc

           Version: 4.8.0

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: sanitizer

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: howa...@nitro.med.uc.edu

                CC: do...@gcc.gnu.org, dvyu...@gcc.gnu.org,

                    ja...@gcc.gnu.org, k...@gcc.gnu.org





After r194120, the -static-libasan option fails to find the required symbols

for linking libasan.a on x86_64-apple-darwin12. For example...



% g++-fsf-4.8 -g -static-libasan -fsanitize=address cond1.C

Undefined symbols for architecture x86_64:

  "__interception::OverrideFunction(unsigned long, unsigned long, unsigned

long*)", referenced from:

      __asan::InitializeMacInterceptors()      in libasan.a(asan_mac.o)

ld: symbol(s) not found for architecture x86_64

collect2: error: ld returned 1 exit status



% nm libasan.0.dylib  | grep OverrideFunction

                 U __ZN14__interception16OverrideFunctionEmmPm



% nm libasan.a | grep OverrideFunction

                 U __ZN14__interception16OverrideFunctionEmmPm



Oddly when compiling normally against the dynamic library...



% g++-fsf-4.8 -g -fsanitize=address cond1.C

% nm ./a.out | grep OverrideFunction

% ./a.out

%



...the resulting executable links in libasan.0.dylib but doesn't complain about

the undefined symbol on execution.

Reply via email to