Opened 4 years ago

Closed 4 years ago

#60937 closed defect (fixed)

flex: Missing -Wl,-undefined -Wl,dynamic_lookup) in libtool.m4

Reported by: vdoublie Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.6.99
Keywords: bigsur Cc:
Port: flex

Description

Many ports fail to build under Xcode 12.0 and macOS11.0 due to failure to include required .h files.

Typical error are (like the one taken from port flex):

:info:build Undefined symbols for architecture x86_64:
:info:build   "_yylex", referenced from:
:info:build       _main in libmain.o

this was a warning with previous macOS version and Xcode, it is now an error.

Attachments (1)

libtool.m4.diff (393 bytes) - added by vdoublie 4 years ago.

Download all attachments as: .zip

Change History (6)

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

Keywords: xcode12 added; bigsur x86_64 undefined symbols removed
Port: many removed

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

Owner: set to ryandesign
Port: flex added
Status: newaccepted
Summary: Missing include .h filesflex: Missing include .h files

Each port will need an individual fix. Let's make this ticket about flex. Do you know which header needs to be included in which file to fix this?

Changed 4 years ago by vdoublie

Attachment: libtool.m4.diff added

comment:3 Changed 4 years ago by vdoublie

Actually it turns out that flex is not missing a simple include, but rather missing linker options (-Wl,-undefined -Wl,dynamic_lookup) which are not configured because configure script has (of course) not been updated to handle macOS 11.

I have attached a patch file that will fix this issue for flex (essentially the same fix as required for gcc10).

The following should be added to the Portfile in order to make use of it:

patchfiles          libtool.m4.diff

post-patch {
    system "cd ${worksrcpath} && autoreconf"
}

Unless of course the patch can be applied upstream.

Many thanks in advance.

Best regards, Vanessa

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

Keywords: bigsur added; xcode12 removed
Summary: flex: Missing include .h filesflex: Missing -Wl,-undefined -Wl,dynamic_lookup) in libtool.m4

Thanks. We're still learning what the various problems on macOS 11 look like. I'll instead use the libtool.m4 patch that Jeremy committed to the libtool port in June.

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

Resolution: fixed
Status: acceptedclosed

In f6fc0fec20aedb9809648326454678e97243eaa6/macports-ports (master):

flex: Patch libtool.m4 to recognize macOS 11+

Closes: #60937

Note: See TracTickets for help on using tickets.