• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
darwin vs linux linkage visibility issues
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

darwin vs linux linkage visibility issues


  • Subject: darwin vs linux linkage visibility issues
  • From: Jack Howarth <email@hidden>
  • Date: Sun, 9 May 2010 11:57:15 -0400

   In the new Link Time Optimization support for darwin
in current FSF gcc trunk, we have run into one lto testcase
that passes under linux with binutils but fails for darwin's
linker. The reduced testcase is...

[MacPro:~/lto_bug] howarth% cat 20081222_0.h
int x();

[MacPro:~/lto_bug] howarth% cat 20081222_1.c
#include "20081222_0.h"

/* Actually, call "x" "INT_X", and make it hidden.  */
extern __typeof (x) x
	__asm__ ("INT_x")
	__attribute__ (( __visibility__ ("hidden")));

int x ()
{
  return 7;
}

/* Make an externally-visible symbol "X" that's an alias for INT_x.  */
extern __typeof (x) EXT_x
	__asm__ ("x")
	__attribute__ (( __alias__ ("INT_x")));

This fails to compile under darwin with the error...

[MacPro:~/lto_bug] howarth% gcc -O0 -c -o c_lto_20081222_1.o 20081222_1.c
20081222_1.c:16: error: only weak aliases are supported in this configuration

whereas if the last line of 20081222_1.c is changed to...

        __attribute__ (( weak, __alias__ ("INT_x")));

the error becomes...

[MacPro:~/lto_bug] howarth% gcc -O0 -c -o c_lto_20081222_1.o 20081222_1.c
20081222_1.c:16: error: ‘EXT_x’ aliased to undefined symbol ‘INT_x’

Both variations of the testcase are accepted by gcc under linux. My
question is whether the second form of the testcase is undefined behavior
or if it is a valid form and I should file a radar on this issue?
      Thanks in advance for any advice.
                 Jack
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: darwin vs linux linkage visibility issues
      • From: Peter O'Gorman <email@hidden>
  • Prev by Date: Re: Absolute Addressing and asm
  • Next by Date: Make build with static library on 10.4
  • Previous by thread: Re: Absolute Addressing and asm
  • Next by thread: Re: darwin vs linux linkage visibility issues
  • Index(es):
    • Date
    • Thread