Opened 18 months ago

Closed 14 months ago

Last modified 14 months ago

#67486 closed defect (fixed)

bc: link fails for 10.6: duplicate symbol _edit in bc.o and main.o

Reported by: mascguy (Christopher Nielsen) Owned by: mascguy (Christopher Nielsen)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: snowleopard Cc: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Port: bc

Description

After updating bc to add a build dep against texinfo - needed for Ventura - builds for 10.6 are failing with a link error:

ld: duplicate symbol _edit in bc.o and main.o for architecture i386

Presumably texinfo isn't the culprit, since there isn't any linkage to it.

Could this be due to libedit, or...?

Change History (8)

comment:1 Changed 18 months ago by mascguy (Christopher Nielsen)

Not surprisingly, installing either without +libedit - or using +readline - works fine. It's only the former that's now problematic.

comment:2 Changed 14 months ago by Christopher Nielsen <mascguy@…>

Resolution: fixed
Status: assignedclosed

In 5e43aacc47f690434f133129f710ffd97f09ef9e/macports-ports (master):

bc: fallback to +readline, for 10.6 and earlier

Fixes: #67486

comment:3 in reply to:  1 Changed 14 months ago by mascguy (Christopher Nielsen)

Replying to mascguy:

Not surprisingly, installing either without +libedit - or using +readline - works fine. It's only the former that's now problematic.

Took a few minutes to look at upstream's configure script, etc - along with perusing the various sources and headers (both for bc, as well as libedit) - and it's not immediately obvious where public symbol _edit is coming from. But it's definitely an issue, as it exists in every bc object file.

So for now, let's fallback to +readline for 10.6 and earlier.

comment:4 Changed 14 months ago by jmroot (Joshua Root)

The edit variable is defined (not declared) in global.h, so every file that includes it will have its own definition. The definition should probably be moved to global.c and extern declarations put in global.h.

comment:5 in reply to:  4 Changed 14 months ago by mascguy (Christopher Nielsen)

Replying to jmroot:

The edit variable is defined (not declared) in global.h, so every file that includes it will have its own definition. The definition should probably be moved to global.c and extern declarations put in global.h.

While that makes sense, why does linking only fail on 10.6?

comment:6 Changed 14 months ago by jmroot (Joshua Root)

Different compiler, so possibly different defaults for common linkage.

comment:8 Changed 14 months ago by Christopher Nielsen <mascguy@…>

In 1c167e1cfd0420c0737787fb2496b9e3af2b39db/macports-ports (master):

bc: patch for libedit dupe symbols; revert +readline fallback

See: #67486

Note: See TracTickets for help on using tickets.