tech-pkg archive

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

Re: using clang from pkgsrc to build packages?



> pkgsrc clang uses libstdc++ right now, and requires gcc 4.8 to build

A different clang-related issue is:

... on NetBSD/amd64 8.0, pkgsrc defaults to build e.g.
gnustep-base with clang, but fails with this excerpt from
config.log:

configure:3678: gcc -V >&5
clang-5.0: error: unsupported option '-V -Qunused-arguments'
clang-5.0: error: no input files
configure:3682: $? = 1
configure:3705: checking for C compiler default output file name
configure:3727: gcc -O2 -I/usr/pkg/include -I/usr/pkg/share/GNUstep/include -I/usr/include -I/usr/pkg/include -I/usr/pkg/share/GNUstep/include -I/usr/include -I/usr/pkg/include -I/usr/pkg/include -I/usr/pkg/include -L/usr/pkg/lib -L/usr/pkg/share/GNUstep/lib -Wl,-R/usr/pkg/lib -Wl,-R/usr/pkg/share/GNUstep/lib -L/usr/lib -Wl,-R/usr/lib -lobjc -lpthread -L/usr/pkg/lib -L/usr/pkg/lib -L/usr/pkg/lib conftest.c  >&5
/usr/pkgsrc/devel/gnustep-base/work/.buildlink/lib/libobjc.so: undefined reference to `_Unwind_GetDataRelBase'
/usr/pkgsrc/devel/gnustep-base/work/.buildlink/lib/libobjc.so: undefined reference to `_Unwind_SetGR'
...

(and more undefined _Unwind* symbols).  Hm, the libobjc.so it
links with is from gnustep-objc, and contrary to the base system
libobjc.so, it doesn't have a run-time dependency on libgcc_s.so
which defines these symbols:

d3: {16} ldd /usr/pkgsrc/devel/gnustep-base/work/.buildlink/lib/libobjc.so
/usr/pkgsrc/devel/gnustep-base/work/.buildlink/lib/libobjc.so:
        -lpthread.1 => /usr/lib/libpthread.so.1
        -lc.12 => /usr/lib/libc.so.12
d3: {17}
d3: {17} ldd /usr/lib/libobjc.so
/usr/lib/libobjc.so:
        -lgcc_s.1 => /usr/lib/libgcc_s.so.1
        -lc.12 => /usr/lib/libc.so.12
d3: {18}
d3: {19} ls -l /usr/pkgsrc/devel/gnustep-base/work/.buildlink/lib/libobjc.so
lrwxr-xr-x  1 he  125  23 Dec 30 14:36 /usr/pkgsrc/devel/gnustep-base/work/.buildlink/lib/libobjc.so -> /usr/pkg/lib/libobjc.so
d3: {20}
d3: {20} ls -l /usr/pkg/lib/libobjc.so
lrwxr-xr-x  1 root  wheel  16 Dec 24 15:43 /usr/pkg/lib/libobjc.so -> libobjc.so.4.6.0
d3: {21}
d3: {22} pkg_info -F /usr/pkg/lib/libobjc.so
Information for gnustep-objc-1.6.1nb2:
...
d3: {23} nm -op /usr/pkg/lib/libobjc.so /usr/lib/libobjc.so | egrep '_Unwind_GetDataRelBase'
nm: /usr/pkg/lib/libobjc.so: no symbols
/usr/lib/libobjc.so:                 U _Unwind_GetDataRelBase@@GCC_3.0
d3: {24}
d3: {25} file /usr/pkg/lib/libobjc.so.4.6.0 
/usr/pkg/lib/libobjc.so.4.6.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, for NetBSD 8.0, stripped
d3: {26}

(Why on earth does it strip a shared library?!?)

...

Re-building gnustep-objc gets me here:

d3: {42} file ./work/libobjc2-1.6.1/obj/libobjc.so.4.6.0 
./work/libobjc2-1.6.1/obj/libobjc.so.4.6.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, for NetBSD 8.0, with debug_info, not stripped
d3: {43} nm -op !$ | grep Unwind
nm -op ./work/libobjc2-1.6.1/obj/libobjc.so.4.6.0 | grep Unwind
./work/libobjc2-1.6.1/obj/libobjc.so.4.6.0:                 U _Unwind_GetDataRelBase
./work/libobjc2-1.6.1/obj/libobjc.so.4.6.0:                 U _Unwind_SetGR
./work/libobjc2-1.6.1/obj/libobjc.so.4.6.0:                 U _Unwind_GetLanguageSpecificData
./work/libobjc2-1.6.1/obj/libobjc.so.4.6.0:                 U _Unwind_RaiseException
./work/libobjc2-1.6.1/obj/libobjc.so.4.6.0:                 U _Unwind_SetIP
./work/libobjc2-1.6.1/obj/libobjc.so.4.6.0:                 U _Unwind_GetRegionStart
./work/libobjc2-1.6.1/obj/libobjc.so.4.6.0:                 U _Unwind_GetTextRelBase
./work/libobjc2-1.6.1/obj/libobjc.so.4.6.0:                 U _Unwind_Resume
./work/libobjc2-1.6.1/obj/libobjc.so.4.6.0:                 U _Unwind_GetIP
d3: {44} 

So how is this supposed to work?

Regards,

- Håvard


Home | Main Index | Thread Index | Old Index