This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [build] Define HAVE_GAS_HIDDEN on Darwin
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: Mike Stump <mikestump at comcast dot net>
- Cc: gcc-patches at gcc dot gnu dot org, David Edelsohn <dje dot gcc at gmail dot com>, Iain Sandoe <iains at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>, Richard Henderson <rth at redhat dot com>
- Date: Thu, 19 May 2011 19:33:12 +0200
- Subject: Re: [build] Define HAVE_GAS_HIDDEN on Darwin
- References: <yddiptqbrdb.fsf@manam.CeBiTec.Uni-Bielefeld.DE> <FE557EFA-8A67-446C-A224-10EE400C4E0A@comcast.net>
Mike Stump <mikestump@comcast.net> writes:
> On May 4, 2011, at 5:08 AM, Rainer Orth wrote:
>> The following patch is a prerequisite for making
>>
>> [lto, testsuite] Don't use visibility on targets that don't support it (PR lto/47334)
>> http://gcc.gnu.org/ml/gcc-patches/2011-04/msg00295.html
>
>> -# define USE_LINKONCE_INDIRECT (SUPPORTS_ONE_ONLY)
>> +# define USE_LINKONCE_INDIRECT (SUPPORTS_ONE_ONLY) && !TARGET_MACHO
>
> Generally speaking, we don't litter the backend with things like this.
> We consider this trashy, and we limit the trash to config/...
>
> Now, if you invent a feature (bug) for which this is really testing,
> and used it instead here, and then put that into the darwin.h file or
> into an as autoconf test, I think it would be fine. Ok with that
> version. If a build/configure/visibility person wants to object or
> insist on a better way to do what you want to do, I'd defer to them.
The problem is the assumption that HAVE_GAS_HIDDEN implies that the
assembler supports the .hidden mnemonic, not visibility in general,
which is no longer true now.
Unfortunately, one cannot use targetm.asm_out.assemble_visibility in
dwarf2asm.c (dw2_output_indirect_constant_1) since the former expects a
tree arg, not an arbitrary string.
The cleanest way to account for this seems to allow overriding
USE_LINKONCE_INDIRECT in target headers (darwin.h in this case).
If Jason or Richard consider this appropriate, I'll modify the patch
accordingly and apply after retesting.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University