cannot build glib with --enable-dtrace (which is default) on Solaris
Submitted by Eugene M. Zheganin
Link to original bug (#688580)
Description
Created attachment 229281 ful 'gmake' building stage illustrating the first error.
I cannot build glib with --enable-dtrace
(which is default).
I'm trying to build it with the -m64
compiler flag. On native Solaris. (11.1)
First of all, the configure stage of the building process doesn't honor this -m64 flag when it concerns the dtrace, so the glib_probes.o file is built in 32-bit mode, and I'm getting this error:
*** Warning: Linking the shared library libglib-2.0.la against the non-libtool
*** objects glib_probes.o is not portable!
ld: fatal: file glib_probes.o: wrong ELF class: ELFCLASS32
ld: fatal: file processing errors. No output written to .libs/libglib-2.0.so.0.3200.4
collect2: ld returned 1 exit status
This can be easily fixed by adding the -64 switch in the glib/Makefile:
glib_probes.o: glib_probes.d Makefile
$(AM_V_GEN) $(DTRACE) -G -s $< -o $@
^^^^^^^^^^^^^^^^^^^^^^^ here.
But then I'm getting the next error:
gmake[2]: Entering directory `/home/emz/src/glib-2.32.4/glib'
CCLD gtester
Undefined first referenced
symbol in file
__dtrace_glib___slice(float, long double,...)(...) ./.libs/libglib-2.0.so
__dtrace_glib___mem__alloc ./.libs/libglib-2.0.so
__dtrace_glib___slice__alloc ./.libs/libglib-2.0.so
__dtrace_glib___mem(float, long double,...)(...) ./.libs/libglib-2.0.so
__dtrace_glib___mem__realloc ./.libs/libglib-2.0.so
__dtrace_glib___quark__new ./.libs/libglib-2.0.so
ld: fatal: symbol referencing errors. No output written to .libs/gtester
collect2: ld returned 1 exit status
gmake[2]: *** [gtester] Error 1
gmake[2]: Leaving directory `/home/emz/src/glib-2.32.4/glib'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/home/emz/src/glib-2.32.4/glib'
gmake: *** [all] Error 2
This is probably because the dtrace-processed object file (I suppose the same glib_probes.o) isn't copied to .libs subdirectory after the processing. This is, of course easily fixable, but I'm still getting the same error, because (I suppose) glib_probes.o isn't included in gtester object dependencies.
I didn't managed to find where should it be included fast enough, so I'm reporting this.
The whole building process can be fixed by using --disable-dtrace
configure key, but... you know.
And yeah, by the way. Sorry it took so long, but this problem is common to all of the latest dtrace-enabled glib releases on any modern Solaris version, including 10, 11, 11.1.
It would be really nice if this would be fixed.
Attachment 229281, "ful 'gmake' building stage illustrating the first error.":
glib-dtrace.log
Version: 2.34.x