I have downloaded glib 2.56 sources from here:
https://download.gnome.org/sources/glib/2.56/
And then i am trying to build & install 32-bit glib library on 64-bit x86_64 platform using following commands:-
../configure CC='/local/common/pkgs/gcc/v6.3.0p2/bin/gcc -m32' CXX='/local/common/data/gcc/v6.3.0p2/bin/g++ -m32' CFLAGS='-fPIC -O2' CXXFLAGS='-fPIC -O2' LD_LIBRARY_PATH=/local/common/data/gcc/v6.3.0p2/lib LDFLAGS=-m32 --enable-static=yes --prefix=/home/gout/source_glib/32bit_glib/glib-2.56.1/glib_32bit --enable-libmount=no PYTHON=/local/common/data/python/v2.7.6/bin/python --with-pcre=/home/gout/pcre_32bit/pcre-8.20/pcre_install
make
make install
While building code (using 'make' command). I am hitting following issue:-
/local/common/pkgsData/gcc-v6.3.0p2/Linux/RHEL6.0-2013-x86_64/bin/ld: i386:x86-64 architecture of input file `.libs/glib_probes.o' is incompatible with i386 output
I found that file 'glib_probes.' is getting created with 64bit architecture.
[gout@il-gout glib]$ file .libs/glib_probes.o
.libs/glib_probes.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped
Above particular file is getting created by command :-
/bin/sh ../libtool --mode=compile --silent --tag=CC dtrace -G -s ../../glib/glib_probes.d -o glib_probes.lo
Rule where we are running above command from glib source is :-
glib_probes.lo: glib_probes.d
$(AM_V_GEN) $(LIBTOOL) --mode=compile $(AM_V_lt) --tag=CC $(DTRACE) -G -s $< -o $@
variable LIBTOOL points to libtool script which got created after running ./configure script. I have mentioned CC= '/local/common/pkgs/gcc/v6.3.0p2/bin/gcc -m32' to configure script, Still this particular file glib_probes.o is getting created with 64 bit architecture.. Not sure whats wrong in creating glib library.
I verified that all other files were created with 32-bit architecture except above file... Please help me in fixing this issue. This issue leads to issue failing creating libglib-2.0.la
CCLD libglib-2.0.la
/local/common/data/gcc-v6.3.0p2/Linux/RHEL6.0-2013-x86_64/bin/ld: i386:x86-64 architecture of input file `.libs/glib_probes.o' is incompatible with i386 output
The Meson build script that glib uses does not pass down the
CCsetting specified at configure time. Systemtap'sdtracetool usesCCfrom the environment, so you could call make like this:Alternatively, you can disable those probes at configure time using
--disable-dtraceif you do not need them.