tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Small compiler issues



Hi all,

I've got two small issues with the GCC shipped with NetBSD. The system
I'm talking about is running 5.x, but AFAIK, there hasn't been any
majort upgrade since.

1)
The "-print-file-name" option does not seem to be functional. This
happen only with the "system" compiler. The "tools" compiler is
working as expected:

"System" compiler:
% gcc -print-file-name=include
include

"Tools" compiler:
% /tools/tools-i386/bin/i486--netbsdelf-gcc -print-file-name=include
/tools/tools-i386/lib/gcc/i486--netbsdelf/4.1.3/include

2)
When using `gcc' to build a C++ source, appending `-lstdc++' to the
library list does not automatically bring `-lm'. As shown below:

% echo 'int main() { return 0; }' | gcc -x c++ -o /dev/null - -lstdc++
/usr/lib/libstdc++.so: undefined reference to `log'
/usr/lib/libstdc++.so: undefined reference to `sqrt'
/usr/lib/libstdc++.so: undefined reference to `cosh'
/usr/lib/libstdc++.so: undefined reference to `ceil'
/usr/lib/libstdc++.so: undefined reference to `floor'
[...]

The following works fine:
% echo 'int main() { return 0; }' | gcc -x c++ -o /dev/null - -lstdc++ -lm

FreeBSD complete successfully with the first command, as does Linux.
So this issue would mostly be about having the same behavior across
all system.

Any hints on these issues ?

Thanks in advance,
 - Arnaud


Home | Main Index | Thread Index | Old Index