Bug 8899 - -error_unresolved doesn't work for AIX
Summary: -error_unresolved doesn't work for AIX
Status: RESOLVED INVALID
Alias: None
Product: Samba 3.6
Classification: Unclassified
Component: Build environment (show other bugs)
Version: 3.6.4
Hardware: PPC AIX
: P5 enhancement
Target Milestone: ---
Assignee: Björn Jacke
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-26 07:39 UTC by Lőrinczy Zsigmond
Modified: 2012-04-26 16:01 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lőrinczy Zsigmond 2012-04-26 07:39:43 UTC
Compiling Samba-3.6.4/source3, there is a point when script configure tries to guess a method to get a ld-warning for unresolved externs. Indeed, option -error_unresolved does cause an error message, because it means option -e with parameter 'rror_unresolved', meaning: the entry point is function rror_unresolved. The flag in question would be -bernotok.
Comment 1 Lőrinczy Zsigmond 2012-04-26 07:41:11 UTC
Or, via gcc: -Wl,-bernotok
Comment 2 Björn Jacke 2012-04-26 08:36:51 UTC
according to http://pic.dhe.ibm.com/infocenter/aix/v6r1/index.jsp?topic=%2Fcom.ibm.aix.cmds%2Fdoc%2Faixcmds3%2Fld.htm "-z defs" should do the same as -ernotok on AIX ld. Can you attach the config.log from that machine?

(Also adding such a AIX machine to the build farm would be very welcome, this help fixing things like this and keep up good AIX support in samba)
Comment 3 Lőrinczy Zsigmond 2012-04-26 09:55:15 UTC
"-z defs" should do the same as -ernotok on AIX ld
True, but only in -bsvr4 mode

config.log:

configure:19615: checking if -Wl,-z,defs works
configure:19629: gcc -o conftest -O  -Iinclude -I./include  -I. -I. -I./../lib/replace -I./../lib/tevent 
-I./librpc -I./.. -I./../lib/popt -Wl,-z,defs  -L./bin conftest.c     >&5
ld: 0706-005 Cannot find or open file: defs
        ld:open(): No such file or directory
collect2: ld returned 255 exit status
configure:19629: $? = 1
...
configure:19635: result: no
configure:19615: checking if -error_unresolved works
configure:19629: gcc -o conftest -O  -Iinclude -I./include  -I. -I. -I./../lib/replace -I./../lib/tevent 
-I./librpc -I./.. -I./../lib/popt -error_unresolved  -L./bin conftest.c     >&5
ld: 0711-327 WARNING: Entry point not found: rror_unresolved
ld: 0711-244 ERROR: No csects or exported symbols have been saved.
collect2: ld returned 8 exit status
configure:19629: $? = 1
...
configure:19635: result: no
configure:19615: checking if -Wl,-error_unresolved works
configure:19629: gcc -o conftest -O  -Iinclude -I./include  -I. -I. -I./../lib/replace -I./../lib/tevent 
-I./librpc -I./.. -I./../lib/popt -Wl,-error_unresolved  -L./bin conftest.c     >&5
ld: 0711-327 WARNING: Entry point not found: rror_unresolved
ld: 0711-244 ERROR: No csects or exported symbols have been saved.
collect2: ld returned 8 exit status
configure:19629: $? = 1
...
configure:19635: result: no

Well, seeing this, I don't really see why does it use option -error_unresolved when configure correctly detects it doesn't work.
Comment 4 Björn Jacke 2012-04-26 10:49:24 UTC
I also can't see how the configure run of this config.log added -error_unresolved to any compile flags. Can you attach the complete config.log and the resulting Makefile, please?
Comment 5 Lőrinczy Zsigmond 2012-04-26 13:00:51 UTC
Okay, it was me: I happened to define LDFLAGS as '-Wl,-brtl' to enable standalone shared libs work; this also changed the result of -error_unresolved

with -brtl: 
ld: 0711-327 WARNING: Entry point not found: rror_unresolved

without it: 
ld: 0711-327 WARNING: Entry point not found: rror_unresolved
ld: 0711-244 ERROR: No csects or exported symbols have been saved.

So I think we might even close this as a local problem.
Comment 6 Björn Jacke 2012-04-26 13:38:06 UTC
yes, looks like a local problem. It should be working if you set the LDFLAGS 
*before* running configure though because preset LDFLAGS are also being used in the configure tests.
Comment 7 Lőrinczy Zsigmond 2012-04-26 16:01:17 UTC
True, the problem still exists in my special case (I _have_to_ use option -brtl), but it's not something that couldn't be saved with a sed-replace.
Thank you for your help.