Fix .ctors/.dtors header configure test for bootstrapping

Richard Henderson rth@twiddle.net
Wed Mar 7 22:37:00 GMT 2012


On 03/07/12 14:30, Joseph S. Myers wrote:
> -  AC_TRY_LINK([], [
> -__attribute__ ((constructor)) void ctor (void) { puts("ctor"); }
> -__attribute__ ((destructor))  void dtor (void) { puts("dtor"); }
> +  LIBC_TRY_LINK_STATIC([
> +__attribute__ ((constructor)) void ctor (void) { }
> +__attribute__ ((destructor))  void dtor (void) { }

I recommend an asm("") in those function bodies.

Gcc could legitimately eliminate those functions as empty.
I think that's the reason for the puts hack originally.


r~



More information about the Libc-alpha mailing list