On 2019/08/20 22:43, Lawrence Teo wrote:
> On Tue, Aug 20, 2019 at 04:32:48PM +0200, Christian Weisgerber wrote:
> > A few days ago, I did a test bulk build on amd64 with gcc, g++, and
> > libstdc++ removed from the system.  Ports should not use these any
> > longer on clang platforms.
> > 
> > security/ghidra failed to build right away since it has stdc++ in
> > WANTLIB.  Further testing shows:
> > 
> > * If you build ghidra on a system where gcc/g++/libstdc++ are
> >   available, it does indeed link something against libstdc++ and
> >   port-lib-depends-check indicates WANTLIB+=stdc++.
> > 
> > * If you build ghidra on a system where gcc/g++/libstdc++ are NOT
> >   available, it still builds fine, something is linked against
> >   libc++/libc++abi/pthread and port-lib-depends-check consequently
> >   indicates WANTLIB+=${COMPILER_LIBCXX}.
> > 
> > There must be some magic in the build where it first tries to use
> > g++ and falls back to c++.  Unfortunately, the actual build commands
> > are hidden and the build is run by some Java tool, so it's not
> > obvious what's going on.
> > 
> > The port should honor CXX or at least not use g++.  Maybe Lawrence
> > or somebody else can take a look...
> > 
> > -- 
> > Christian "naddy" Weisgerber                          na...@mips.inka.de
> 
> I took a look, and you're right that it's not obvious at all.
> 
> I'm not familiar with that part of the build process so I'll have a lot
> of poking around to do. :)  My current suspect is a hardcoded "g++"
> inside jython-standalone-2.7.1.jar.
> 
> If someone else wants to look around as well, help is very welcome!
> 

Is this enough? Untested beyond "does it create the right symlink".

Index: Makefile
===================================================================
RCS file: /cvs/ports/security/ghidra/Makefile,v
retrieving revision 1.4
diff -u -p -r1.4 Makefile
--- Makefile    12 Jul 2019 20:49:02 -0000      1.4
+++ Makefile    21 Aug 2019 08:21:22 -0000
@@ -39,6 +39,7 @@ post-extract:
                ${WRKSRC}/ghidraRun
        @perl -pi -e 's,#!/bin/bash,#!${LOCALBASE}/bin/bash,' \
                ${WRKSRC}/support/launch.sh
+       ln -s c++ ${WRKDIR}/bin/g++
 
 do-install:
        ${INSTALL_DATA_DIR} ${PREFIX}/share/java/ghidra

Reply via email to