Opened 4 years ago

Closed 4 years ago

#60260 closed defect (fixed)

gd2 fails to compile undefined _getline for i386

Reported by: rmottola (Riccardo) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version:
Keywords: leopard Cc: ballapete (Peter "Pete" Dyballa)
Port: gd2

Description

libtool: link: /opt/local/bin/clang-mp-5.0 -pipe -Os -DDEFAULT_FONTPATH=\"/System/Library/Fonts:/Library/Fonts\" -arch i386 -fvisibility=hidden -Wall -Wl,-headerpad_max_install_names -arch i386 -o .libs/pngtogd2 pngtogd2.o  -L/opt/local/lib ./.libs/libgd.dylib /opt/local/lib/libiconv.dylib -lz /opt/local/lib/libpng16.dylib /opt/local/lib/libfontconfig.dylib /opt/local/lib/libfreetype.dylib /opt/local/lib/libjpeg.dylib /opt/local/lib/libtiff.dylib /opt/local/lib/libwebp.dylib -pthread
libtool: link: /opt/local/bin/clang-mp-5.0 -pipe -Os -DDEFAULT_FONTPATH=\"/System/Library/Fonts:/Library/Fonts\" -arch i386 -fvisibility=hidden -Wall -Wl,-headerpad_max_install_names -arch i386 -o .libs/annotate annotate.o  -L/opt/local/lib ./.libs/libgd.dylib /opt/local/lib/libiconv.dylib -lz /opt/local/lib/libpng16.dylib /opt/local/lib/libfontconfig.dylib /opt/local/lib/libfreetype.dylib /opt/local/lib/libjpeg.dylib /opt/local/lib/libtiff.dylib /opt/local/lib/libwebp.dylib -pthread
Undefined symbols for architecture i386:
  "_getline", referenced from:
      _main in annotate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
/bin/sh ../libtool  --tag=CC   --mode=link /opt/local/bin/clang-mp-5.0  -pipe -Os -DDEFAULT_FONTPATH=\"/System/Library/Fonts:/Library/Fonts\" -arch i386 -fvisibility=hidden -Wall  -L/opt/local/lib -Wl,-headerpad_max_install_names -arch i386 -o gd2copypal gd2copypal.o libgd.la -liconv -L/opt/local/lib -L/opt/local/lib -lz -L/opt/local/lib -L/opt/local/lib -lpng16 -L/opt/local/lib -L/opt/local/lib -lfreetype -L/opt/local/lib -L/opt/local/lib -lfontconfig -lfreetype -L/opt/local/lib -L/opt/local/lib -ljpeg -L/opt/local/lib -L/opt/local/lib -ltiff -L/opt/local/lib  -lwebp
make[2]: *** [annotate] Error 1
make[2]: *** Waiting for unfinished jobs....

I get this very mysterious message I hope it is not a linker issue, because I am using a recent ld64 suggested by Ken needed for other packages!

Change History (9)

comment:1 Changed 4 years ago by kencu (Ken)

leopard's libc doesn't have that function, but it can be replaced usually by adding the legacysupport PortGroup.

comment:2 Changed 4 years ago by jmroot (Joshua Root)

Owner: set to ryandesign
Status: newassigned

comment:3 Changed 4 years ago by kencu (Ken)

I added legacysupport on my own copy, and it does fix the gd2 port.

comment:4 Changed 4 years ago by ballapete (Peter "Pete" Dyballa)

Cc: ballapete added

comment:5 Changed 4 years ago by ballapete (Peter "Pete" Dyballa)

On PPC Tiger, Mac OS X 10.4.11, the same error happens and the same solution works.

comment:6 Changed 4 years ago by rmottola (Riccardo)

Works for me too

PortGroup                   legacysupport 1.0

Not knowing what version number to add I put 1.0, but it worked

comment:7 Changed 4 years ago by ballapete (Peter "Pete" Dyballa)

On PPC Leopard, Mac OS X 10.5.8, same error and same cure.

comment:8 in reply to:  6 Changed 4 years ago by ballapete (Peter "Pete" Dyballa)

In case you'll want to find the version number in the future again, this command from the command line in bash or zsh will give you a few examples:

find $(dirname $(dirname $(dirname $(port file gd2)))) -type f -name Portfile | xargs grep -i 'legacysupport '

(In case you'll find a shorter Port name than gd2 substitute that one for gd2 – and you'll save at least one character to type (or copy)! And maybe half a CPU cycle…)

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

Resolution: fixed
Status: assignedclosed

In 229bef1dfea38a857b0e44b7f393be507fabca4f/macports-ports (master):

gd2: Add legacysupport portgroup for getline

Closes: #60260

Note: See TracTickets for help on using tickets.