Opened 3 years ago

Last modified 22 months ago

#5388 new bug

ghcilink003 and ghcilink006 fail on OSX

Reported by: igloo Owned by:
Priority: low Milestone: 7.6.2
Component: Compiler Version: 7.0.4
Keywords: Cc:
Operating System: MacOS X Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

ghcilink003 and ghcilink006 fail on OSX (both x86 and amd64) for me, e.g.

=====> ghcilink003(normal) 3 of 6 [0, 0, 0]
cd . && $MAKE -s --no-print-directory ghcilink003    </dev/null >ghcilink003.run.stdout 2>ghcilink003.run.stderr
Wrong exit code (expected 0 , actual 2 )
Stdout:

Stderr:
<command line>: user specified .o/.so/.DLL could not be loaded (dlopen(/usr/lib/gcc/i686-apple-darwin10/4.2.1/libstdc++.dylib, 9): no suitable image found.  Did find:
        /usr/lib/gcc/i686-apple-darwin10/4.2.1/libstdc++.dylib: can't map)
Whilst trying to load:  (dynamic) /usr/lib/gcc/i686-apple-darwin10/4.2.1/libstdc++.dylib
Additional directories searched: (none)
make[1]: *** [ghcilink003] Error 1

This seems to be because I can't dlopen libstdc++.dylib:

$ cat q.c

#include <dlfcn.h>
#include <stdio.h>

int main(void) {
    void *p;
    p = dlopen("/usr/lib/gcc/i686-apple-darwin10/4.2.1/libstdc++.dylib", RTLD_LAZY);
    printf("Result: %p\n", p);
    printf("Error: %s\n", dlerror());
    return 0;
}

$ gcc q.c -o q
$ ./q 
Result: 0x0
Error: dlopen(/usr/lib/gcc/i686-apple-darwin10/4.2.1/libstdc++.dylib, 1): no suitable image found.  Did find:
        /usr/lib/gcc/i686-apple-darwin10/4.2.1/libstdc++.dylib: can't map
$ otool -L /usr/lib/gcc/i686-apple-darwin10/4.2.1/libstdc++.dylib
/usr/lib/gcc/i686-apple-darwin10/4.2.1/libstdc++.dylib:
        /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0)
$ file /usr/lib/gcc/i686-apple-darwin10/4.2.1/libstdc++.dylib
/usr/lib/gcc/i686-apple-darwin10/4.2.1/libstdc++.dylib: Mach-O universal binary with 3 architectures
/usr/lib/gcc/i686-apple-darwin10/4.2.1/libstdc++.dylib (for architecture i386):Mach-O dynamically linked shared library stub i386
/usr/lib/gcc/i686-apple-darwin10/4.2.1/libstdc++.dylib (for architecture ppc7400):      Mach-O dynamically linked shared library stub ppc
/usr/lib/gcc/i686-apple-darwin10/4.2.1/libstdc++.dylib (for architecture x86_64):       Mach-O 64-bit dynamically linked shared library stub x86_64

Change History (5)

comment:1 Changed 3 years ago by simonmar

Better mark those tests as broken then. So it appears that all the effort I went to to get libstdc++ to load in GHCi works on Linux only. Sigh :(

comment:2 Changed 3 years ago by batterseapower

Seems to work for me (OS X 10.7, GHC HEAD as of today, build.mk settings from validate). Not sure what the difference in our environments is.

comment:3 Changed 3 years ago by igloo

  • Milestone set to 7.4.1

comment:4 Changed 2 years ago by igloo

  • Milestone changed from 7.4.1 to 7.6.1
  • Priority changed from normal to low

comment:5 Changed 22 months ago by igloo

  • Milestone changed from 7.6.1 to 7.6.2
Note: See TracTickets for help on using tickets.