brandon.bar...@gmail.com wrote:
> I think my current gcc toolchain may be doomed, as it uses the sun
> linker and the gnu assembler! (I read this was a good thing to do, at
> least at some point in history).

Mixing the GNU and Sun assemblers/linkers could issues in Sage, due to 
the way some patches I have applied work.

Sometimes people have written code where gcc is used to pass options 
directly to the linker, using the -Wl flag to gcc.

e.g gcc -Wl,-soname foobar.o ...

In this case, -soname is sent directly to the linker. The -Wa flag can 
be used to send things directly to the assembler.

Many things broke in Sage if the linker used by GCC was not the GNU 
linker, as people tended to send things like (-soname) directly to the 
linker using GNU flags. I got around this by testing for the first 
linker in the path, to see whether it was the GNU or Sun linker. I 
assumed that if the first linker in the path was the Sun linker, then 
people would be using Sun tools and so Sun options should be passed to 
the linker. Conversely, if the first linker in the path was the GNU 
linker, I assumed they were using GNU tools and so GNU options should be 
passed.

I did likewise for the assembler.


Apart from lcacl, I'm not aware of any other code in Sage which sends 
things directly to the assembler ( and lcalc only did this in an attempt 
to suppress warning messages). As such, you should be ok as long as the 
  /usr/ccs/bin is in the path before any GNU linker is. However, on a 
default install of Solaris, the GNU linker is called 'gld' anyway, which 
is not tested in my code.

With hindsight a better test would have been to check what assembler & 
linker the compiler actually uses. This is not so easy to do though, 
since there is no requirement to specify them on the command line when 
building gcc.

As long as you don't have a program called 'ld' in your path before the 
path to the Sun linker, I think you should be ok, but I've not tested 
gcc where a mix of GNU and Sun tools are used. In any case, an error 
message would indicate an incorrect option being passed to the linker.

On both my SPARC and 't2', both gcc's were built by Sun using the Sun 
linker and assembler. So as long as I have the the Sun linker as the 
first thing in my path, I am ok.

I might rethink how this testing is done, but its difficult to think of 
every eventuality.

Dave

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to