installing swig on cfarm210?
Dagobert Michelsen
dam at opencsw.org
Thu Jun 11 09:02:54 CEST 2026
Hi Pat,
> Am 11.06.2026 um 00:11 schrieb Patrice Dumas <pertusus at free.fr>:
>
> On Mon, Jun 08, 2026 at 10:54:10PM +0200, Dagobert Michelsen wrote:
>> Hi Pat,
>>
>>> More precisely, building without Perl flags works ok on cfarm 210, the
>>> command-line that succeeds is:
>>> gcc -o conftest -g -D_STDC_C99= -I/opt/csw/include/ -D_REENTRANT -I/usr/local/include -L/opt/csw/lib/ conftest.c /usr/local/lib/libiconv.so -L/usr/local/lib/64 -L/usr/local/lib -R/usr/local/lib
>>>
>>> With the Perl flags, there is a failure. The command-line is:
>>> The failure:
>>> ld: fatal: file /usr/local/lib/libiconv.so: wrong ELF class: ELFCLASS64
>
>> The error means you are trying to link a 64 bit library to a 32 bit build
>> and /usr/local/lib/libiconv.so <http://libiconv.so/> is 64 bit. I suggest to use /opt/csw/lib
>> for libiconv.so <http://libiconv.so/>.
>
> I tried --without-libiconv-prefix and indeed, it allowed the linking
> with libiconv with Perl compiler and flags to work, with this command
> in the configure test:
> /opt/SUNWspro/bin/cc -o conftest -g -D_STDC_C99= -D_REENTRANT -xO3 -m32 -xarch=sparc -I/opt/csw/bdb48/include -I/opt/csw/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV -I/opt/csw/include/ -D_REENTRANT -I/opt/csw/include -L/opt/csw/lib/ -R /opt/csw/lib -m32 -xarch=sparc -L/opt/csw/lib -lperl -L/opt/csw/bdb48/lib -L/opt/csw/lib -L/usr/lib -L/usr/ccs/lib -L/lib conftest.c /opt/csw/lib//libiconv.so -R/opt/csw/lib/
>
> However, in the main directory, with this command for the configure test:
> gcc -o conftest -g -D_STDC_C99= -I/opt/csw/include/ -D_REENTRANT -L/opt/csw/lib/ conftest.c -liconv
> There is this error at linked program runtime:
> ld.so.1: conftest: fatal: libiconv.so.2: open failed: No such file or directory
> I checked that /opt/csw/lib/libiconv.so.2 exists.
>
> This time there is an obvious difference with OpenCSW setup, Sun CC is
> used in OpenCSW, and I verified that linking against iconv in configure
> works on cfarm21O, with CC=cc. In that case the command is:
> cc -o conftest -g -D_STDC_C99= -I/opt/csw/include/ -D_REENTRANT -I/opt/csw/include -L/opt/csw/lib/ conftest.c /opt/csw/lib//libiconv.so -R/opt/csw/lib/
>
> I do not know if the failure with gcc is an error on my side, or an
> issue in cfarm210.
The difference is -R/opt/csw/lib which includes the runpath in the binary.
You can check with
dump -Lv <binary>
e.g.
dam at unstable10s [unstable10s]:/home/dam/mgar/pkg/apache24/trunk > dump -Lv /opt/csw/bin/gcc
/opt/csw/bin/gcc:
**** DYNAMIC SECTION INFORMATION ****
.dynamic:
[INDEX] Tag Value
[1] NEEDED libkstat.so.1
[2] NEEDED libiconv.so.2
[3] NEEDED libm.so.2
[4] NEEDED librt.so.1
[5] NEEDED libc.so.1
[6] INIT 0x90704
[7] FINI 0x90720
[8] RUNPATH /opt/csw/lib/$ISALIST:/opt/csw/lib:/opt/csw/lib
[9] RPATH /opt/csw/lib/$ISALIST:/opt/csw/lib:/opt/csw/lib
[10] HASH 0x11094
For testing you can directly insert the runpath in the linker by setting
export LD_OPTIONS=/opt/csw/lib
But beware! This insert the runpath before any other path set during build.
Best regards
— Dago
--
"You don't become great by trying to be great, you become great by wanting to do something,
and then doing it so hard that you become great in the process." - xkcd #896
More information about the buildfarm
mailing list