On Mon, Jul 31, 2017 at 07:54:32AM -0700, Jeremy Evans wrote:
> On 07/31 02:35, Marc Espie wrote:
> > On Mon, Jul 31, 2017 at 12:32:22PM +0200, Jeremie Courreges-Anglas wrote:
> > > On Sun, Jul 30 2017, Jeremy Evans <jeremy@openbsd.org> wrote:
> > > > Post clang switch, mednafen fails to link with:
> > > >
> > > > /usr/bin/ld: debug.o: relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC
> > > > debug.o: could not read symbols: Bad value c++: error: linker command failed with exit code 1 (use -v to see invocation)
> > > >
> > > > Despite the fact that COMPILER=gcc is already set, it still picks
> > > > clang.
> > >
> > > Looks like the current way to do that is to set COMPILER = gcc-only.
> > >
> > > I guess there's no easy fix for clang?
> >
> > No, it's more like there hasn't been a lot of incentive yet.
> >
> > You should look at unmangling the linker issue.
>
> I did, but unfortunately I was not able to get it to work. This is made
> more difficult because the error message doesn't even inform you which
> symbol is the problem.
>
> There is pretty extensive use of GCC pragmas in mednafen, it's
> possible that unrecognized pragmas may be the cause of the problem.
>
> I didn't know about COMPILER=gcc-only, since bsd.port.mk doesn't mention
> it (at least in Saturday's snapshot).
>
> Until someone else wants to take a shot at fixing the linker issues
> with clang, can someone OK this diff so at least mednafen will work in
> the meantime?
>
> Thanks,
> Jeremy
>
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/emulators/mednafen/Makefile,v
> retrieving revision 1.18
> diff -u -p -r1.18 Makefile
> --- Makefile 26 Jul 2017 22:45:19 -0000 1.18
> +++ Makefile 31 Jul 2017 14:15:52 -0000
> @@ -24,7 +24,7 @@ WANTLIB += SDL c m pthread sndfile sndio
> WANTLIB += FLAC ogg vorbis vorbisenc ${COMPILER_LIBCXX}
>
> USE_GMAKE = Yes
> -COMPILER = gcc
> +COMPILER = gcc-only
>
> LIB_DEPENDS = audio/libsndfile \
> devel/sdl
Ah, I missed that mednafen is *already* gcc, so yeah, gcc-only will work
fine.
(the reason it's not documented is because we will need slightly more
options for ports that have to be gcc, and I'd like us to try and repair
as much as possible to actually work with clang)
No comments:
Post a Comment