libusdt icon indicating copy to clipboard operation
libusdt copied to clipboard

Hard-coded gcc

Open dper opened this issue 11 years ago • 2 comments

On recent FreeBSD distros, there is no gcc binary. If you install the gcc package, you have binaries like gcc48 and g++48. Or there's the other clang project, which is similar.

I ran across this project when compiling pump.io, which depends on it. What I do to make pump.io is...

env CC=cc CXX=c++ MAKE=gmake npm install

And that works for most of the project dependencies, except not with libusdt. With libusdt, I get the below error message.

gmake: Entering directory '/usr/home/d/src/pump.io/node_modules/bunyan/node_modules/dtrace-provider/build'
  ACTION binding_gyp_libusdt_target_build_libusdt .
Using node: /usr/local/bin/node
Building libusdt for i386
gmake[1]: Entering directory '/usr/home/d/src/pump.io/node_modules/bunyan/node_modules/dtrace-provider/libusdt'
rm -f *.gch
rm -f *.o
rm -f libusdt.a
rm -f test_usdt
rm -f test_usdt32
rm -f test_usdt64
gcc -O2 -Wno-error=unknown-pragmas -I/usr/src/sys/cddl/compat/opensolaris -I/usr/src/sys/cddl/contrib/opensolaris/uts/common -m32   -c -o usdt.o usdt.c
gmake[1]: gcc: Command not found
: recipe for target 'usdt.o' failed
gmake[1]: *** [usdt.o] Error 127
gmake[1]: Leaving directory '/usr/home/d/src/pump.io/node_modules/bunyan/node_modules/dtrace-provider/libusdt'

That's the short version, which I think is sufficient. Greater detail can be found at https://dperkins.org/arc/2014-11-12.pump%20on%20freebsd.html.

I can work around the problem by making a symlink from gcc to gcc48, but that's not elegant. It would be better if the environment variable CC worked.

dper avatar Nov 12 '14 22:11 dper

I have the same problem on Solaris. It is an error in Makefile. The following line in Makefile inserts space between old path and newly added component:

PATH +=:/usr/perl5/5.10.0/bin:/usr/perl5/5.12/bin

So the PATH is then blablabla :/usr/perl5/... and make is unable to find gcc then. If I rewrite the line above as follows it works fine:

export PATH := $(PATH):/usr/perl5/5.10.0/bin:/usr/perl5/5.12/bin

However this maybe works only with GNU make. In any case it fixes the problem for me.

jkryl avatar Nov 02 '16 11:11 jkryl

@jkryl that's definitely a bug, but it's not this particular issue, which is that we need to use "CC := ..." not "CC = "

jlevon avatar May 14 '20 14:05 jlevon