#9872: PolyBoRi incorrectly reports a GNU linker is used with gcc and produces
libraries with text relocations.
------------------------+---------------------------------------------------
Reporter: drkirkby | Owner: tbd
Type: defect | Status: new
Priority: major | Milestone: sage-4.6
Component: packages | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
------------------------+---------------------------------------------------
Comment(by drkirkby):
Replying to [comment:10 AlexanderDreyer]:
> Ok, it seems, that this issue could be fixed in likewise manner like you
fixed it for cliquer.
No, changing a compiler flag will not necessarily work - I just got lucky
with Cliquer.
If it was a matter of just changing a compiler flag, I would have done it.
There does not appear to be anything obviously wrong with the flags in
!PolyBoRi, though perhaps there's some subtle error I have not spotted.
There appears however to be several ways to write shared libraries which
exhibit this problem - one way Leif said is to have a main(), though I've
not confirmed that myself. Another is given on that Sun blog, by having
data declared as constant. Another it to omit -fPIC when compiling, but I
know you have not made that mistake. There are probably other ways.
> So, I can easily fix this upstream. Is is necessary to backport it to
the spkg of #9768? (It only makes sense for that spkg, sinc the dynamic
libraries were ignored before.)
It would be good if you could remove the shared libraries, since if any
code links to them, it will cause problems. I don't know enough about your
code, but if there is a main() getting into the shared library code, then
it might be sensible to do as Leif says, and conditionally include the
main() only when building a standard-alone executable, but not when
building a shared library. In essence, something like:
{{{
foobar1() {
}
foobar2(){
}
#ifdef BUILDING_EXECUTABLE
main() {
foobar1();
foobar2();
}
#endif
}}}
and only include the compiler flag {{{-DBUILDING_EXECUTABLE}}} when
building the code for the executable and not the libraries.
I've no idea if that would work with your code or not. I really don't know
where the problem is, and as you can see from that Sun blog, it is not the
easiest thing to track down.
> > > I'll integrate your linker test in the next stable release.
> >
> > Thank you. I would however use $CC rather than 'gcc'. The {{{-Wl,}}}
option to pass something directly to the linker appears to work with all
compilers I've tried.
>
> Do you mean the environment variable $CC? The polybori spkg already uses
its value.
Yes. My test code used 'gcc' as I quickly put it together yesterday to
test an idea out. I've not tested it fully, but I would certainly replace
my use of gcc in that script with $CC and check it works ok.
> My best,
> Alexander
Dave
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9872#comment:11>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.