From: SourceForge.net <no...@so...> - 2010-02-27 15:59:01
|
Bugs item #2959713, was opened at 2010-02-26 11:25 Message generated for change (Comment added) made by kennykb You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=2959713&group_id=10894 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 53. Configuration and Build Tools Group: development: 8.6b1.1 Status: Open Resolution: None Priority: 7 Private: No Submitted By: Decoster Jos (decosterjos) >Assigned to: Jan Nijtmans (nijtmans) Summary: Link error with gcc 4.1 Initial Comment: Building Tcl from CVS head with gcc 4.1 results in the following link error: /usr/bin/ld: tclTomMathInterface.o: relocation R_X86_64_PC32 against symbol `tclTomMathConstStubs' can not be used when making a shared object; recompile with -fPIC Adding MODULE_SCOPE to tclStubInit.c as suggested by Kevin Kenny: MODULE_SCOPE const TclTomMathStubs tclTomMathConstStubs = { .. solves the issue.. Jos. ---------------------------------------------------------------------- >Comment By: Kevin B KENNY (kennykb) Date: 2010-02-27 10:59 Message: Assigning to nijtmans - Jeff, why'd you assign it back to me? ---------------------------------------------------------------------- Comment By: Jeffrey Hobbs (hobbs) Date: 2010-02-26 17:27 Message: Kevin's patch is correct, except the real question is why these aren't all static. It would need one modification to remove the existing "MODULE_SCOPE" for tclStubs in tclStubInit.c:44. Also, tclOOStubs needs the treatment. Jan - can you please explain why these aren't all being left static? ---------------------------------------------------------------------- Comment By: Kevin B KENNY (kennykb) Date: 2010-02-26 12:04 Message: In gcc 4.1, it is not valid to initialise a data item with a pointer to an exported data item. (It is all right to use a pointer to an exported function or a pointer to a data item at module or static scope.) The problem can be worked around by using -Wl,-Bsymbolic on the link flags, but that approach should not be adopted without further thought: see http://software.intel.com/en-us/articles/performance-tools-for-software-developers-bsymbolic-can-cause-dangerous-side-effects/ for some of the pitfalls. Alternatively, the scope of the Stubs tables can be restricted: the attached patch to tools/genStubs.tcl puls it back to MODULE_SCOPE. Donal Fellows and I discussed the correct linkage for tclTomMathStubs and tclOOStubs, and we believe that both of those tables ought to be 'static' unless there's something that you need to do with them that we fail to comprehend. In any case, I don't understand what you're trying to do with the code that marks them 'static' if they have subinterfaces and 'extern' otherwise. In any case, 'extern' is wrong: all symbols exported from the shared library should be EXTERN, and all symbols internal to it should be MODULE_SCOPE. The attached patch attempts to be conservative: it makes the sharing as wide as possible while still linking successfully. I'd also request that you add some commentary in genStubs.tcl giving the rest of us some indication what you're trying to do. The change to make the tables external rather than static seems somewhat gratuitous, and of course has been observed to break at least one build. ---------------------------------------------------------------------- Comment By: Kevin B KENNY (kennykb) Date: 2010-02-26 11:29 Message: I'm looking into this - it relates to nijtmans's commit to tools/genStubs.tcl on 2010-02-05. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=2959713&group_id=10894 |