Hi there, I'm trying to build CLN 1.1.8 on a G4/Mac OS X 10.3.5 system with the XCode 1.5 tools (i.e. Apple's version of GCC 3.3 and the Mach linker). By disabling shared libraries, I've got quite far with this, up to linking the CLN test case, exam. This gives unresolved externals ending with _ctorend and _dtorend. I've tracked it down to the fact that each object in the library has a _XXX_[cd]torend symbol defined module-local (i.e. nm entry prefixed by "s"). However, each module has an unresolved XXX_[cd]torend symbol (nm entry prefixed by "U"), without the underscore prefix. This is the CL_PROVIDE and CL_REQUIRE macros. My include/cln/config.h has ASM_UNDERSCORE defined. I tried to read the macro definition, but got lost. Can anyone help? I searched the archives for relevant information a few days ago and didn't find any. They seem to have disappeared in the meantime??? Thanks in advance.
On Tue, 17 Aug 2004, Darren Bane wrote:
I'm trying to build CLN 1.1.8 on a G4/Mac OS X 10.3.5 system with the XCode 1.5 tools (i.e. Apple's version of GCC 3.3 and the Mach linker). By disabling shared libraries, I've got quite far with this, up to linking the CLN test case, exam. This gives unresolved externals ending with _ctorend and _dtorend.
I've tracked it down to the fact that each object in the library has a _XXX_[cd]torend symbol defined module-local (i.e. nm entry prefixed by "s"). However, each module has an unresolved XXX_[cd]torend symbol (nm entry prefixed by "U"), without the underscore prefix.
This is a recurring and still unsolved issue. Back in February, John Whitley got stuck at the same point. For the record I quote his last mail on the topic: : Richard B. Kreckel writes: : > Note that you'll find some linker problems at a later stage. : > Somebody knowledgeable about the way that linker works needs to fix this. : : In my Great Quest to get GiNaC running on Mac OS X, I've done some digging on this problem. : The issue lies with the machine-dependent hacks in include/cln/modules.h for forcing : construction time ordering. : The following quote from : http://mail.gnu.org/archive/html/users-prolog/2004-01/msg00028.html : sums up the issue at hand: : : The problem comes down to the fact that Mach-o has lazy linking and : does not allow any changes in the .text section where our compiled : code resides. Therefore the message below, which states " : non-writable section". This means that all external symbols need a : stub construct in the .data section. The code in .text jumps to : .data section, which in the meantime has magically been changed to : point to the actual implementation of the target routine in linked : shared libraries. : : I still need to fullly understand the approach implemented by CL_PROVIDE and related macros in : modules.h, then determine/implement/test the solution for Darwin-based platforms. : : FWIW, I've had to manage this problem in C++ embedded systems before, e.g. via a linker : directive files. I'm unclear as to what motivated the design choices in CLN, such that it even : encounters the constructor ordering problem in the first place?
This is the CL_PROVIDE and CL_REQUIRE macros. My include/cln/config.h has ASM_UNDERSCORE defined. I tried to read the macro definition, but got lost. Can anyone help?
Have you tried fully expanding them, either manually or with the help of the preprocessor (c++ -E)?
I searched the archives for relevant information a few days ago and didn't find any. They seem to have disappeared in the meantime???
No, this list is new. Regards -richy. -- Richard B. Kreckel <http://www.ginac.de/~kreckel/>
Hi,
I'm trying to build CLN 1.1.8 on a G4/Mac OS X 10.3.5 system with the XCode 1.5 tools (i.e. Apple's version of GCC 3.3 and the Mach linker). By disabling shared libraries, I've got quite far with this, up to linking the CLN test case, exam. This gives unresolved externals ending with _ctorend and _dtorend.
Earlier this year, I was able to compile and link CLN (was 1.1.6) on Mac OS X with much help from a correspondent, and I took the time to scribble down the notes for how it was done. Then can be found at: http://www.csl.cornell.edu/~fang/sw/CLN.html Mind you, it was late and I was in a hurry when I wrote this, so I didn't fill in many explanations, nevertheless, you'll find some answers to some of the problems you're encountering.
I've tracked it down to the fact that each object in the library has a _XXX_[cd]torend symbol defined module-local (i.e. nm entry prefixed by "s"). However, each module has an unresolved XXX_[cd]torend symbol (nm entry prefixed by "U"), without the underscore prefix.
This is the CL_PROVIDE and CL_REQUIRE macros. My include/cln/config.h has ASM_UNDERSCORE defined. I tried to read the macro definition, but got lost. Can anyone help?
In fact, one of the steps I've listed is "comment out the #define ASM_UNDERSCORE" line. :)
I searched the archives for relevant information a few days ago and didn't find any. They seem to have disappeared in the meantime???
I honestly haven't had much success building any post-1.2.0 version of GiNaC on Mac OS X, and haven't had much time to play around with it. But I hope the above link helps. Good luck. David Fang Computer Systems Laboratory Electrical & Computer Engineering Cornell University http://www.csl.cornell.edu/~fang/ -- *gag* work in progress
Darren Bane wrote:
I've tracked it down to the fact that each object in the library has a _XXX_[cd]torend symbol defined module-local (i.e. nm entry prefixed by "s"). However, each module has an unresolved XXX_[cd]torend symbol (nm entry prefixed by "U"), without the underscore prefix.
This is the CL_PROVIDE and CL_REQUIRE macros. My include/cln/config.h has ASM_UNDERSCORE defined. I tried to read the macro definition, but got lost. Can anyone help?
The appended patch fixes it. With it, I can compile CLN (with --enable-static and --disable-shared, to avoid the linking problems that I got when trying to compile GMP with --enable-cxx as a shared library.) Thanks for the report. Bruno
On 19 Lún 2004, at 11:30, Bruno Haible wrote:
[snipped] The appended patch fixes it. With it, I can compile CLN (with --enable-static and --disable-shared, to avoid the linking problems that I got when trying to compile GMP with --enable-cxx as a shared library.) [snipped]
Thanks, that fixed my problems. I can now confirm that the {GMP 4.1.3, CLN 1.1.8, Readline 5.0, GiNaC 1.2.3} combination compiles to static libraries on Mac OS X 10.3, and at least the toy GiNaC examples that I've tried work as well.
participants (4)
-
Bruno Haible
-
Darren Bane
-
David Fang
-
Richard B. Kreckel