https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64089

Eric Gallager <egall at gwmail dot gwu.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |egall at gwmail dot gwu.edu

--- Comment #8 from Eric Gallager <egall at gwmail dot gwu.edu> ---
(In reply to Jack Howarth from comment #3)
> Note that on darwin libgcc handles its symbol map using...
> 
>  -Wl,-exported_symbols_list,$(SHLIB_MAP) 
> 
> on SHLIB_LINK.

So I tried this, replacing $(SHLIB_MAP) with $(srcdir)/jit/libgccjit.map (since
SHLIB_MAP seemed to not be defined), and it gave me the following warning:

ld: warning: missing line-end at end of file "../../gcc/jit/libgccjit.map"

...followed by a bunch of undefined symbol errors (which were the real
problem). So instead I had to just remove the mapfile line entirely, as in the
patch in the blog post linked to from here:

(In reply to David Malcolm from comment #7)
> (In reply to howarth from comment #6)
> > I don't believe this can be an issue on darwin as we always default to
> > producing PIC oode.
> Ah, ok.
> 
> Thanks for filing this bug.
> 
> I'm wondering what other problems libgccjit has on darwin.  If you hack in
> the required options into jit/Makefile.in, to what extent do "make" and
> "make check-jit" work?
> 
> I notice this blog post from a couple of months ago:
>   http://adek.io/2014/10/04/gcc-jit-on-osx/
> which talks about an issue with:
>   dyld: Library not loaded: libgccjit.so.0
> 
> Perhaps on darwin we need to be setting DYLD_LIBRARY_PATH in the various
> places where we're currently setting LD_LIBRARY_PATH?  (perhaps that should
> be a separate bug, perhaps under a "libgccjit on darwin" tracker bug?).

So anyways, besides what I wrote above, for some reason I also had to add
"-Wl,-undefined,dynamic_lookup" due to the "environ" symbol being missing,
which makes no sense to me, because it should be there... But that got it to
build for me though.

And as for running "make check-jit", well, that testsuite didn't even run due
to it failing with:

ERROR: tcl error sourcing
/Users/ericgallager/gcc-git/gcc/testsuite/jit.dg/jit.exp.
ERROR: sh: /Users/ericgallager/gcc-git/libstdc++-v3/scripts/testsuite_flags: No
such file or directory

...which seems wrong to me. Shouldn't the testsuite_flags script be generated
in the builddir instead of in the srcdir? But anyways, that's digressing, and
unrelated to the linkage failure that the ticket was originally about.

Reply via email to