On Thursday 10 November 2005 12:54, Daniel Mueller wrote:
gcc -shared -L/usr/lib32 -o pam_access.so dynamic/pam_access.o -lnsl -lc -L../pammodutil -lpammodutil -L../../libpam -lpam /usr/bin/ld: skipping incompatible /usr/lib32/libnsl.so when searching for -lnsl /usr/bin/ld: skipping incompatible /usr/lib32/libnsl.a when searching for -lnsl /usr/bin/ld: skipping incompatible /usr/lib32/libc.so when searching for
Oh oh, you have to check the Makefile. It is using a separate step to link all object files together into one shared library file. Unfortunately it forgot to add GCC's '-m32' command line option. :-( (Remember -m32 = 32bit output, -m64 = 64bit output; standard/if nothing specified => -m64)
Your CFLAGS are okay but they are not applied here. Try it again with the 'CC' special variable set:
[..] export CC="gcc -m32" ./configure .. bla bla make .. bla bla [..]
No luck there, I did however check out the Makefile... .and as a result, I've done the following: build() { export PKG_CONFIG_PATH=/usr/lib32/pkgconfig export CFLAGS="-m32 -O2 -march=i686 -pipe" export CXXFLAGS="-m32 -O2 -march=i686 -pipe" export LDFLAGS="-m32 -L/usr/lib32 $LDFLAGS" cd $name-$version linux32 ./configure --prefix=/usr --libdir=/usr/lib32 --enable-fakeroot="$PKG" linux32 make make install } This gets me a lot farther... except now it dies here. gcc -o bigcrypt bigcrypt_main.o bigcrypt.o -lcrypt -lnsl -L../pammodutil -lpammodutil -lcrypt /usr/bin/ld: skipping incompatible ../pammodutil/libpammodutil.a when searching for -lpammodutil /usr/bin/ld: cannot find -lpammodutil collect2: ld returned 1 exit status make[2]: *** [bigcrypt] Error 1 make[2]: Leaving directory `/usr/ports/my_ports/linux-pam32/work/src/Linux-PAM-0.81/modules/pam_unix' make[1]: *** [all] Error 1 make[1]: Leaving directory `/usr/ports/my_ports/linux-pam32/work/src/Linux-PAM-0.81/modules' make: *** [modules] Error 2 =======> ERROR: Building '/usr/ports/my_ports/linux-pam32/Linux-PAM#0.81-1.pkg.tar.gz' failed. I think I hate this makefile... This Makefile imports a Make.Rules... Here is the relevent section: # generic build setup OS=linux CC=gcc CFLAGS=$(WARNINGS) -D$(OS) -m32 -O2 -march=i686 -pipe $(OS_CFLAGS) $(HEADER_DIRS) LDFLAGS=-m32 -L/usr/lib32 -L/usr/lib32 LD=gcc LD_D=gcc -shared -m32 -L/usr/lib32 -L/usr/lib32 LD_L=gcc -shared -m32 -L/usr/lib32 -L/usr/lib32 I've added an export for CC and LD... but it doesn't care. I think I may need to manually patch this file. -- David M. Strang