Mike Stump <mikest...@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