Opened 4 years ago

Closed 6 months ago

Last modified 6 months ago

#5388 closed bug (duplicate)

ghcilink003 and ghcilink006 fail on OSX

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

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 (8)

comment:1 Changed 4 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 4 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 4 years ago by igloo

  • Milestone set to 7.4.1

comment:4 Changed 3 years ago by igloo

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

comment:5 Changed 3 years ago by igloo

  • Milestone changed from 7.6.1 to 7.6.2

comment:6 Changed 11 months ago by thoughtpolice

  • Milestone changed from 7.6.2 to 7.10.1

Moving to 7.10.1.

comment:7 Changed 6 months ago by thomie

  • difficulty set to Unknown
  • Resolution set to duplicate
  • Status changed from new to closed

I'm combining all OS X testsuite failures in #9389, but these 2 particular tests don't seem to be failing anymore.

comment:8 Changed 6 months ago by thomie

  • Milestone 7.10.1 deleted
Note: See TracTickets for help on using tickets.