tech-toolchain archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
re: Small compiler issues
> 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
while this is clearly different, i'm not sure it is a bug. the
-print-file-name is used to find libraries. since there's no
"include" in any of the default library paths, the result is what
you see -- what you asked for. eg, it works fine for libs:
% gcc -print-file-name=libgcc.a
/usr/lib/libgcc.a
what is your use-case for this?
> 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.
this seems like a bug. can you please file a PR? thanks.
.mrg.
Home |
Main Index |
Thread Index |
Old Index