gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sparc: ld: --relax and -r may not be used together


From: Riccardo Mottola
Subject: Re: sparc: ld: --relax and -r may not be used together
Date: Sun, 10 Apr 2011 13:26:37 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.15) Gecko/20110402 Icedove/3.1.9

Hi,
On my machine I can't find any relax option anywhere with either GCC 4.1.2
or GCC 4.7.0.  Both "gcc --target-help | grep relax" and
"gcc -dumpspecs | grep relax" return nothing.

It makes sense; since it's an "-m" option, it is a machine-dependent option.
So, it is supported on some target machines, but not on others.  I think
GCC 4.6.0+ became more strict/accurate in checking target flags.
Yes, it could be that it is enabled only on certain platforms. The stricter checking makes it less portable. I just checked that on 4.5 on intel debian I don't have it either, but it works.
The simple solution would be to only add -mno-relax on Sparc, if you're having
the problem on Sparc.  We don't even need a configure check; in target.make,
simply find the right location for it, and add a make conditional to add
-mno-relax on the target CPU that requires it.  Something like (untested
pseudo-code, to give you something to start with) --

# On Sparc, this is required because otherwise GCC automatically passes
# -relax to the linker, which conflicts with the -r passed via -Wl,-r.
ifeq ($(findstring sparc, $(GNUSTEP_TARGET_CPU)), sparc)
   OBJC_MERGE_CMD += -mno-relax
endif
Since it is machine dependent and from the people having problems it is not OS restricted (I think I have seen also openbsd or solaris mentioned) that would be a good starting fix, to check on most platforms.
If it works on all sparc OS / compiler compilations... it would be fine.
In case we discover e.g. ARM needs that too, we can always add it.

We need to know how clang behaves, in case, you can restrict the above to gcc only.

Riccardo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]