Opened 15 years ago

Closed 15 years ago

#20982 closed defect (fixed)

jpeg does not build on Snow Leopard with i386 arch set

Reported by: cbradney@… Owned by: waqar@…
Priority: Normal Milestone:
Component: ports Version: 1.8.0
Keywords: snowleopard Cc: ryandesign (Ryan Carsten Schmidt), MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Port: jpeg

Description (last modified by mf2k (Frank Schima))

jpeg port does not build on Snow Leopard with the i386 build arch set in macports.conf. There are no other ports installed at the time. It fails to link as shown here:

/usr/bin/gcc-4.2 -O2 -arch i386 -isystem/opt/local/include -I. -c ./wrbmp.c  -fno-common -DPIC -o .libs/wrbmp.lo
rm -f .libs/rdcolmap.lo
/usr/bin/gcc-4.2 -O2 -arch i386 -isystem/opt/local/include -I. -c ./rdcolmap.c  -fno-common -DPIC -o .libs/rdcolmap.lo
/usr/bin/gcc-4.2 -O2 -arch i386 -isystem/opt/local/include -I. -c ./rdcolmap.c -o rdcolmap.o >/dev/null 2>&1
/usr/bin/gcc-4.2 -O2 -arch i386 -isystem/opt/local/include -I. -c ./wrbmp.c -o wrbmp.o >/dev/null 2>&1
mv -f .libs/rdcolmap.lo rdcolmap.lo
./libtool --mode=compile /usr/bin/gcc-4.2 -O2 -arch i386 -isystem/opt/local/include -I. -c ./jpegtran.c
rm -f .libs/jpegtran.lo
/usr/bin/gcc-4.2 -O2 -arch i386 -isystem/opt/local/include -I. -c ./jpegtran.c  -fno-common -DPIC -o .libs/jpegtran.lo
mv -f .libs/wrbmp.lo wrbmp.lo
./libtool --mode=compile /usr/bin/gcc-4.2 -O2 -arch i386 -isystem/opt/local/include -I. -c ./transupp.c
rm -f .libs/transupp.lo
/usr/bin/gcc-4.2 -O2 -arch i386 -isystem/opt/local/include -I. -c ./transupp.c  -fno-common -DPIC -o .libs/transupp.lo
/usr/bin/gcc-4.2 -O2 -arch i386 -isystem/opt/local/include -I. -c ./jpegtran.c -o jpegtran.o >/dev/null 2>&1
mv -f .libs/jpegtran.lo jpegtran.lo
./libtool --mode=compile /usr/bin/gcc-4.2 -O2 -arch i386 -isystem/opt/local/include -I. -c ./rdjpgcom.c
rm -f .libs/rdjpgcom.lo
/usr/bin/gcc-4.2 -O2 -arch i386 -isystem/opt/local/include -I. -c ./rdjpgcom.c  -fno-common -DPIC -o .libs/rdjpgcom.lo
/usr/bin/gcc-4.2 -O2 -arch i386 -isystem/opt/local/include -I. -c ./rdjpgcom.c -o rdjpgcom.o >/dev/null 2>&1
/usr/bin/gcc-4.2 -O2 -arch i386 -isystem/opt/local/include -I. -c ./transupp.c -o transupp.o >/dev/null 2>&1
mv -f .libs/rdjpgcom.lo rdjpgcom.lo
./libtool --mode=compile /usr/bin/gcc-4.2 -O2 -arch i386 -isystem/opt/local/include -I. -c ./wrjpgcom.c
rm -f .libs/wrjpgcom.lo
/usr/bin/gcc-4.2 -O2 -arch i386 -isystem/opt/local/include -I. -c ./wrjpgcom.c  -fno-common -DPIC -o .libs/wrjpgcom.lo
/usr/bin/gcc-4.2 -O2 -arch i386 -isystem/opt/local/include -I. -c ./wrjpgcom.c -o wrjpgcom.o >/dev/null 2>&1
mv -f .libs/wrjpgcom.lo wrjpgcom.lo
./libtool --mode=link "/usr/bin/gcc-4.2 -O2 -arch i386 -isystem/opt/local/include -I." -o libjpeg.la jcapimin.lo jcapistd.lo jctrans.lo jcparam.lo jdatadst.lo jcinit.lo jcmaster.lo jcmarker.lo jcmainct.lo jcprepct.lo jccoefct.lo jccolor.lo jcsample.lo jchuff.lo jcphuff.lo jcdctmgr.lo jfdctfst.lo jfdctflt.lo jfdctint.lo jdapimin.lo jdapistd.lo jdtrans.lo jdatasrc.lo jdmaster.lo jdinput.lo jdmarker.lo jdhuff.lo jdphuff.lo jdmainct.lo jdcoefct.lo jdpostct.lo jddctmgr.lo jidctfst.lo jidctflt.lo jidctint.lo jidctred.lo jdsample.lo jdcolor.lo jquant1.lo jquant2.lo jdmerge.lo jcomapi.lo jutils.lo jerror.lo jmemmgr.lo jmemnobs.lo \
		-rpath /opt/local/lib -no-undefined -version-info 62
rm -fr .libs/libjpeg.la .libs/libjpeg.* .libs/libjpeg.*
mv -f .libs/transupp.lo transupp.lo
./libtool --mode=link /usr/bin/gcc-4.2  -o rdjpgcom rdjpgcom.lo -L/opt/local/lib
/usr/bin/gcc-4.2 -o rdjpgcom rdjpgcom.o -L/opt/local/lib 
ld: warning: in rdjpgcom.o, file is not of required architecture
Undefined symbols:
  "_main", referenced from:
      start in crt1.10.6.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [rdjpgcom] Error 1
make: *** Waiting for unfinished jobs....
/usr/bin/gcc-4.2 -O2 -arch i386 -isystem/opt/local/include -I. -dynamiclib  -o .libs/libjpeg.62.0.0.dylib  jcapimin.lo jcapistd.lo jctrans.lo jcparam.lo jdatadst.lo jcinit.lo jcmaster.lo jcmarker.lo jcmainct.lo jcprepct.lo jccoefct.lo jccolor.lo jcsample.lo jchuff.lo jcphuff.lo jcdctmgr.lo jfdctfst.lo jfdctflt.lo jfdctint.lo jdapimin.lo jdapistd.lo jdtrans.lo jdatasrc.lo jdmaster.lo jdinput.lo jdmarker.lo jdhuff.lo jdphuff.lo jdmainct.lo jdcoefct.lo jdpostct.lo jddctmgr.lo jidctfst.lo jidctflt.lo jidctint.lo jidctred.lo jdsample.lo jdcolor.lo jquant1.lo jquant2.lo jdmerge.lo jcomapi.lo jutils.lo jerror.lo jmemmgr.lo jmemnobs.lo  -lc  -install_name /opt/local/lib/libjpeg.62.dylib -compatibility_version 63 -current_version 63.0
(cd .libs && rm -f libjpeg.62.dylib && ln -s libjpeg.62.0.0.dylib libjpeg.62.dylib)
(cd .libs && rm -f libjpeg.dylib && ln -s libjpeg.62.0.0.dylib libjpeg.dylib)
ar cru .libs/libjpeg.a  jcapimin.o jcapistd.o jctrans.o jcparam.o jdatadst.o jcinit.o jcmaster.o jcmarker.o jcmainct.o jcprepct.o jccoefct.o jccolor.o jcsample.o jchuff.o jcphuff.o jcdctmgr.o jfdctfst.o jfdctflt.o jfdctint.o jdapimin.o jdapistd.o jdtrans.o jdatasrc.o jdmaster.o jdinput.o jdmarker.o jdhuff.o jdphuff.o jdmainct.o jdcoefct.o jdpostct.o jddctmgr.o jidctfst.o jidctflt.o jidctint.o jidctred.o jdsample.o jdcolor.o jquant1.o jquant2.o jdmerge.o jcomapi.o jutils.o jerror.o jmemmgr.o jmemnobs.o 
ranlib .libs/libjpeg.a
creating libjpeg.la
(cd .libs && rm -f libjpeg.la && ln -s ../libjpeg.la libjpeg.la)
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_jpeg/work/jpeg-6b" && /usr/bin/make -j2 all " returned error 2
Command output: /usr/bin/gcc-4.2 -O2 -arch i386 -isystem/opt/local/include -I. -c ./rdjpgcom.c  -fno-common -DPIC -o .libs/rdjpgcom.lo
/usr/bin/gcc-4.2 -O2 -arch i386 -isystem/opt/local/include -I. -c ./rdjpgcom.c -o rdjpgcom.o >/dev/null 2>&1
/usr/bin/gcc-4.2 -O2 -arch i386 -isystem/opt/local/include -I. -c ./transupp.c -o transupp.o >/dev/null 2>&1
mv -f .libs/rdjpgcom.lo rdjpgcom.lo
./libtool --mode=compile /usr/bin/gcc-4.2 -O2 -arch i386 -isystem/opt/local/include -I. -c ./wrjpgcom.c
rm -f .libs/wrjpgcom.lo
/usr/bin/gcc-4.2 -O2 -arch i386 -isystem/opt/local/include -I. -c ./wrjpgcom.c  -fno-common -DPIC -o .libs/wrjpgcom.lo
/usr/bin/gcc-4.2 -O2 -arch i386 -isystem/opt/local/include -I. -c ./wrjpgcom.c -o wrjpgcom.o >/dev/null 2>&1
mv -f .libs/wrjpgcom.lo wrjpgcom.lo
./libtool --mode=link "/usr/bin/gcc-4.2 -O2 -arch i386 -isystem/opt/local/include -I." -o libjpeg.la jcapimin.lo jcapistd.lo jctrans.lo jcparam.lo jdatadst.lo jcinit.lo jcmaster.lo jcmarker.lo jcmainct.lo jcprepct.lo jccoefct.lo jccolor.lo jcsample.lo jchuff.lo jcphuff.lo jcdctmgr.lo jfdctfst.lo jfdctflt.lo jfdctint.lo jdapimin.lo jdapistd.lo jdtrans.lo jdatasrc.lo jdmaster.lo jdinput.lo jdmarker.lo jdhuff.lo jdphuff.lo jdmainct.lo jdcoefct.lo jdpostct.lo jddctmgr.lo jidctfst.lo jidctflt.lo jidctint.lo jidctred.lo jdsample.lo jdcolor.lo jquant1.lo jquant2.lo jdmerge.lo jcomapi.lo jutils.lo jerror.lo jmemmgr.lo jmemnobs.lo \
		-rpath /opt/local/lib -no-undefined -version-info 62
rm -fr .libs/libjpeg.la .libs/libjpeg.* .libs/libjpeg.*
mv -f .libs/transupp.lo transupp.lo
./libtool --mode=link /usr/bin/gcc-4.2  -o rdjpgcom rdjpgcom.lo -L/opt/local/lib
/usr/bin/gcc-4.2 -o rdjpgcom rdjpgcom.o -L/opt/local/lib 
ld: warning: in rdjpgcom.o, file is not of required architecture
Undefined symbols:
  "_main", referenced from:
      start in crt1.10.6.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [rdjpgcom] Error 1
make: *** Waiting for unfinished jobs....
/usr/bin/gcc-4.2 -O2 -arch i386 -isystem/opt/local/include -I. -dynamiclib  -o .libs/libjpeg.62.0.0.dylib  jcapimin.lo jcapistd.lo jctrans.lo jcparam.lo jdatadst.lo jcinit.lo jcmaster.lo jcmarker.lo jcmainct.lo jcprepct.lo jccoefct.lo jccolor.lo jcsample.lo jchuff.lo jcphuff.lo jcdctmgr.lo jfdctfst.lo jfdctflt.lo jfdctint.lo jdapimin.lo jdapistd.lo jdtrans.lo jdatasrc.lo jdmaster.lo jdinput.lo jdmarker.lo jdhuff.lo jdphuff.lo jdmainct.lo jdcoefct.lo jdpostct.lo jddctmgr.lo jidctfst.lo jidctflt.lo jidctint.lo jidctred.lo jdsample.lo jdcolor.lo jquant1.lo jquant2.lo jdmerge.lo jcomapi.lo jutils.lo jerror.lo jmemmgr.lo jmemnobs.lo  -lc  -install_name /opt/local/lib/libjpeg.62.dylib -compatibility_version 63 -current_version 63.0
(cd .libs && rm -f libjpeg.62.dylib && ln -s libjpeg.62.0.0.dylib libjpeg.62.dylib)
(cd .libs && rm -f libjpeg.dylib && ln -s libjpeg.62.0.0.dylib libjpeg.dylib)
ar cru .libs/libjpeg.a  jcapimin.o jcapistd.o jctrans.o jcparam.o jdatadst.o jcinit.o jcmaster.o jcmarker.o jcmainct.o jcprepct.o jccoefct.o jccolor.o jcsample.o jchuff.o jcphuff.o jcdctmgr.o jfdctfst.o jfdctflt.o jfdctint.o jdapimin.o jdapistd.o jdtrans.o jdatasrc.o jdmaster.o jdinput.o jdmarker.o jdhuff.o jdphuff.o jdmainct.o jdcoefct.o jdpostct.o jddctmgr.o jidctfst.o jidctflt.o jidctint.o jidctred.o jdsample.o jdcolor.o jquant1.o jquant2.o jdmerge.o jcomapi.o jutils.o jerror.o jmemmgr.o jmemnobs.o 
ranlib .libs/libjpeg.a
creating libjpeg.la
(cd .libs && rm -f libjpeg.la && ln -s ../libjpeg.la libjpeg.la)

Warning: the following items did not execute (for jpeg): org.macports.activate org.macports.build org.macports.destroot org.macports.install
Error: Status 1 encountered during processing.

Change History (9)

comment:1 Changed 15 years ago by mf2k (Frank Schima)

Description: modified (diff)
Keywords: snowleopard added; jpeg removed
Owner: changed from macports-tickets@… to waqar@…

comment:2 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… mcalhoun@… added

You could test whether updating to jpeg 7 would fix this.

comment:3 Changed 15 years ago by M8R-au0fku@…

I ran into the same issue.

This worked for me on Snow Leopard, however:

I downloaded and extracted jpegsrc.v7.tar and then hit in terminal:

cd jpeg-7
cp /usr/share/libtool/config/config.sub .
cp /usr/share/libtool/config/config.guess .
./configure --enable-shared --enable-static
make
sudo mkdir -p /usr/local/include
sudo mkdir -p /usr/local/lib
sudo mkdir -p /usr/local/man/man1
sudo make install

comment:4 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

And that built for i386 and not x86_64?

comment:5 Changed 15 years ago by cbradney@…

Hi, sorry, I cannot test right now with i386 as I managed to get Qt's dmg Cocoa installer working for building Scribus, so all of my macports install is x86_64 now. When my other imac (dying logic board) comes back from not being repaired, I can see if I can do a Leopard install on it and build an i386 set of Macports.. should be back in the next 2 or 3 days.

comment:6 in reply to:  3 Changed 15 years ago by jkebinger@…

I think this would build it using the gcc defaults on SL which I believe are 64 bit

Replying to M8R-au0fku@…:

I ran into the same issue.

This worked for me on Snow Leopard, however:

I downloaded and extracted jpegsrc.v7.tar and then hit in terminal:

cd jpeg-7
cp /usr/share/libtool/config/config.sub .
cp /usr/share/libtool/config/config.guess .
./configure --enable-shared --enable-static
make
sudo mkdir -p /usr/local/include
sudo mkdir -p /usr/local/lib
sudo mkdir -p /usr/local/man/man1
sudo make install

comment:7 Changed 15 years ago by jkebinger@…

I had this problem too. I have build_arch set to i386 and the build failed, but it does compile with the +universal variant.

comment:8 Changed 15 years ago by florian.feldhaus@…

Hi!
I had the same problem. I found the following workaround:
open the makefile with e.g.:

sudo vi /opt/local/var/macports/sources/rsync.macports.org/release/ports/graphics/jpeg/work/jpeg-6b/Makefile

and add your architecture (i386 or x86_64 or both) to the ldflags:

LDFLAGS = -arch i386 ...

Snow Leopard seems to have some different mechanisms for the arch flags. Perhaps this can be put in the Portfile somehow?

comment:9 in reply to:  8 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: newclosed

Replying to florian.feldhaus@…:

LDFLAGS = -arch i386 ...

Fixed in r58027, thanks for the hint.

Note: See TracTickets for help on using tickets.