#67235 closed defect (fixed)

giflib5 broken on <= 10.6: cc1: error: unrecognized command line option "-Wno-format-truncation"

Reported by: barracuda156 Owned by: Schamschula (Marius Schamschula)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: snowleopard, leopard, powerpc, rosetta Cc:
Port: giflib5

Description

/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_giflib5/giflib5/work/compwrap/cc/usr/bin/gcc-4.2 -std=gnu99 -fPIC -Wall -Wno-format-truncation -O2 -I/opt/local/include  -c -o dgif_lib.o dgif_lib.c
cc1: error: unrecognized command line option "-Wno-format-truncation"
make: *** [dgif_lib.o] Error 1

Change History (9)

comment:1 Changed 19 months ago by Marius Schamschula <mschamschula@…>

In 77b5f9c96d068ee90723fce8da68f52da8400183/macports-ports (master):

giflib5: attempt to fix build on Snow Leopard and below

See: #67235

comment:2 in reply to:  1 Changed 19 months ago by barracuda156

Replying to Marius Schamschula <mschamschula@…>:

In 77b5f9c96d068ee90723fce8da68f52da8400183/macports-ports (master):

giflib5: attempt to fix build on Snow Leopard and below

See: #67235

This works, thank you!

comment:3 in reply to:  1 Changed 19 months ago by barracuda156

Replying to Marius Schamschula <mschamschula@…>:

In 77b5f9c96d068ee90723fce8da68f52da8400183/macports-ports (master):

giflib5: attempt to fix build on Snow Leopard and below

See: #67235

Turned out, it does not respect Macports archflags too:

ld: warning: in libgif.a, file was built for unsupported file format which is not the architecture being linked (ppc)
ld: warning: in libutil.a, file was built for unsupported file format which is not the architecture being linked (ppc)
Undefined symbols:
  "_GifMakeMapObject", referenced from:
      _main in cc4aBUg8.o
  "_DGifGetLine", referenced from:
      _main in cc4aBUg8.o
      _main in cc4aBUg8.o
  "_EGifPutImageDesc", referenced from:
      _main in cc4aBUg8.o
  "_DGifOpenFileHandle", referenced from:
      _main in cc4aBUg8.o
  "_GifQprintf", referenced from:
      _LoadRGB in cc4aBUg8.o
      _LoadRGB in cc4aBUg8.o
      _LoadRGB in cc4aBUg8.o
      _LoadRGB in cc4aBUg8.o
      _main in cc4aBUg8.o
      _main in cc4aBUg8.o
      _main in cc4aBUg8.o
      _main in cc4aBUg8.o
      _main in cc4aBUg8.o
      _main in cc4aBUg8.o
      _main in cc4aBUg8.o
  "_GAPrintHowTo", referenced from:
      _main in cc4aBUg8.o
      _main in cc4aBUg8.o
  "_EGifPutScreenDesc", referenced from:
      _main in cc4aBUg8.o
  "_EGifOpenFileHandle", referenced from:
      _main in cc4aBUg8.o
  "_DGifCloseFile", referenced from:
      _main in cc4aBUg8.o
  "_DGifGetRecordType", referenced from:
      _main in cc4aBUg8.o
  "_GAPrintErrMsg", referenced from:
      _main in cc4aBUg8.o
  "_DGifOpenFileName", referenced from:
      _main in cc4aBUg8.o
  "_DGifGetExtension", referenced from:
      _main in cc4aBUg8.o
  "_EGifCloseFile", referenced from:
      _main in cc4aBUg8.o
  "_PrintGifError", referenced from:
      _main in cc4aBUg8.o
      _main in cc4aBUg8.o
      _main in cc4aBUg8.o
      _main in cc4aBUg8.o
      _main in cc4aBUg8.o
  "_GifQuantizeBuffer", referenced from:
      _main in cc4aBUg8.o
  "_EGifPutLine", referenced from:
      _main in cc4aBUg8.o
  "_GAGetArgs", referenced from:
      _main in cc4aBUg8.o
  "_DGifGetImageDesc", referenced from:
      _main in cc4aBUg8.o
  "_DGifGetExtensionNext", referenced from:
      _main in cc4aBUg8.o
  "_GifNoisyPrint", referenced from:
      _GifNoisyPrint$non_lazy_ptr in cc4aBUg8.o
     (maybe you meant: _GifNoisyPrint$non_lazy_ptr)
ld: symbol(s) not found

So Rosetta fails.

comment:4 Changed 19 months ago by barracuda156

I guess we can just add archflags into the existing patch:

--- Makefile.orig	2023-04-14 14:56:29.000000000 -0500
+++ Makefile	2023-04-14 14:57:04.000000000 -0500
@@ -8,7 +8,7 @@
 #
 OFLAGS = -O0 -g
 OFLAGS  = -O2
-CFLAGS  = -std=gnu99 -fPIC -Wall -Wno-format-truncation $(OFLAGS)
+CFLAGS  = @ARCHFLAGS@ -std=gnu99 -fPIC -Wall $(OFLAGS)
 
 SHELL = /bin/sh
 TAR = tar

comment:5 Changed 19 months ago by Schamschula (Marius Schamschula)

So the makefile PG doesn't help here?

comment:6 Changed 19 months ago by ryandesign (Ryan Carsten Schmidt)

Well the Makefile says CFLAGS = which overwrites the environment variable the makefile portgroup sets. You can tell the makefile portgroup to use an arg instead of an env var, but that will then overwrite everything in the Makefile's CFLAGS, which also wouldn't be correct; we want a combination of MacPorts flags and the ones the Makefile wants. The best solution is probably to patch the Makefile so that it says CFLAGS +=, so that it appends to the flags the portgroup sets. This is a matter to bring to the attention of the developers.

In addition, this Makefile wants the optimization flags specified separtely in OFLAGS, so you could do that by adding:

configure.args-append OFLAGS="${configure.optflags}"

A revbump should go along with that.

comment:7 Changed 19 months ago by Schamschula (Marius Schamschula)

Changing CFLAGS = to CFLAGS += make sense, but shouldn't configure.args-append OFLAGS="${configure.optflags}" be build.args-append OFLAGS="${configure.optflags}" as there is no configure phase?

comment:8 Changed 19 months ago by Marius Schamschula <mschamschula@…>

In f0b07c4d89b0442025b7887c01944fdb4be8c188/macports-ports (master):

giflib5: deal with '-Wno-format-truncation' errors and warnings

See: #67235

comment:9 Changed 13 months ago by Schamschula (Marius Schamschula)

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.