[Bug bootstrap/64349] [5 Regression] Bootstrapping Ada fails on darwin(9|10).

2014-12-19 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64349

--- Comment #3 from Dominique d'Humieres  ---
> The patch attached above uses the correct API - and works AFAICT
> on powerpc-darwin9 and x86_64-darwin12.

It works also on x86_64-apple-darwin10: see results posted at

https://gcc.gnu.org/ml/gcc-testresults/2014-12/msg02400.html.

Thanks for the patch.


[Bug bootstrap/64349] [5 Regression] Bootstrapping Ada fails on darwin(9|10).

2014-12-18 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64349

--- Comment #2 from Iain Sandoe  ---
Created attachment 34299
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34299&action=edit
proper fix.

So, the rules on Darwin say that it's OK to access _environ directly from the
main executable, but it is NOT OK to access it from a shared libaray. Instead,
one should use the _NSGetEnviron() API).

===

My initial patch works because it allows the symbol to be satisfied at load
time by dynamic lookup (it will be found from the exe, I assume).

===


The patch attached above uses the correct API - and works AFAICT on
powerpc-darwin9 and x86_64-darwin12.


[Bug bootstrap/64349] [5 Regression] Bootstrapping Ada fails on darwin(9|10).

2014-12-18 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64349

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2014-12-18
 CC||iains at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Dominique d'Humieres  ---
Bootstrapping Ada fails on darwin(9|10) with

ld: warning: can't add line info to anonymous symbol __const@0 from s-arit64.o

This can be fixed with the following patch from Iain Sandoe

--- ../_clean/gcc/ada/gcc-interface/Makefile.in2014-11-26
10:44:12.0 +0100
+++ gcc/ada/gcc-interface/Makefile.in2014-11-26 10:55:45.0 +0100
@@ -2884,6 +2884,7 @@ gnatlib-shared-darwin:
 -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
 $(SO_OPTS) \
+-Wl,-undefined,dynamic_lookup \
 -Wl,-install_name,@rpath/libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
 $(MISCLIB)
 cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
@@ -2891,6 +2892,7 @@ gnatlib-shared-darwin:
 -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
 $(GNATRTL_TASKING_OBJS) \
 $(SO_OPTS) \
+-Wl,-undefined,dynamic_lookup \
 -Wl,-install_name,@rpath/libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
 $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
 cd $(RTSDIR); $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \