Opened 12 years ago

Closed 12 years ago

#5088 closed Patches (fixed)

Odd definition of main() inside library on AIX

Reported by: hstong@… Owned by: John Maddock
Milestone: Boost 1.47.0 Component: regex
Version: Boost 1.45.0 Severity: Problem
Keywords: Cc: ccambly@…

Description

There seems to be a definition of main() that is there only for __IBMCPP__. This definition seems to be doing more harm than good for me.

Attachments (1)

regex.cpp.patch (337 bytes ) - added by hstong@… 12 years ago.
Patch to libs/regex/src/regex.cpp removing main() from library

Download all attachments as: .zip

Change History (6)

by hstong@…, 12 years ago

Attachment: regex.cpp.patch added

Patch to libs/regex/src/regex.cpp removing main() from library

comment:1 by anonymous, 12 years ago

I was under the impression that IBM's compiler needed a main() in order to build regex as a DLL? Maybe that restriction has been removed? What issues does it's presence cause, and what compiler version are you using?

Thanks, John.

comment:2 by anonymous, 12 years ago

Ah wait... is this on AIX with IBM's linker, or on Linux with the system linker?

comment:3 by hstong@…, 12 years ago

This is AIX with IBM's linker.

A normal build produces:

ld: 0711-224 WARNING: Duplicate symbol: .main

When using -qextchk (adds XCOFF type-check information):

ld: 0711-197 ERROR: Type mismatches for symbol: .main

The confusion over needing main() in the library sounds like an issue with not setting -bnoentry on the link step. I believe that this was resolved with a fix to vacpp.jam.

comment:4 by John Maddock, 12 years ago

Milestone: To Be DeterminedBoost 1.47.0

comment:5 by John Maddock, 12 years ago

Resolution: fixed
Status: newclosed

(In [68318]) Building with IBM C++ no longer needs a main() entry point. Fixes #5088.

Note: See TracTickets for help on using tickets.