-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Il 29/05/2013 23:36, Thomas Schwinge ha scritto: > Hi! > > On Wed, 29 May 2013 16:21:38 +0200, Paolo Bonzini <bonz...@gnu.org> > wrote: >> Il 29/05/2013 12:50, Thomas Schwinge ha scritto: >>>>> How about we use something like the following [...] patch? >>>>> In essence, replace the manual parsing in >>>>> gcc/ada/gcc-interface/Makefile.in by using the values the >>>>> configure script already computed for us. This is largely >>>>> straightforward (I would hope); please especially review >>>>> the more involved cases such as the one where I'm now >>>>> using linux%eabi -- for example, does that do the right >>>>> thing or interfere with the Android configurations? > >> I agree that using $(target_os) and linux% matches is a better >> way to strip out the "-gnu"s. >> >> The patch is long, but I think I reviewed it carefully enough. >> It's okay for mainline. > > Thanks for the review. Before I commit however: > >> Regarding the android change: >> >>> -ifeq ($(strip $(filter-out arm%-linux,$(arch)-$(osys)) $(if >>> $(findstring eabi,$(word 4,$(targ))),,$(word 4,$(targ)))),) >>> +ifeq ($(strip $(filter-out arm% linux%eabi,$(target_cpu) >>> $(target_os))),) >> >> This is okay, it will match arm-none-linux-androideabi both >> before and after > > Well, upon more carful inspection I came to realize that the > old/still current code accepts arm-*-linux-*eabi but also plain > arm-*-linux, which my new code no longer accepts. Is the old/still > current behavior intentional here, or a bug? It has been > introduced in commit f49eb158fa5618dbd1130e47281e0bae13798ec6 > (r192475):
Looking at http://thread.gmane.org/gmane.comp.gcc.patches/265800, it's a bug. The right way would have been something like $(if $(findstring eabi,$(word 4,$(targ))),,no-match) Your patch fixes it. It would be really really nice to move all this to fragments, using a saner bash case statement to pick the right one. It's a huge amount of work though. > gcc/ada/ 2012-10-15 Matthias Klose <d...@ubuntu.com> > > * gcc-interface/Makefile.in: Match arm*-*-linux-*eabi* for ARM > Linux/GNU. > > -ifeq ($(strip $(filter-out arm% linux-gnueabi,$(arch) > $(osys)-$(word 4,$(targ)))),) +ifeq ($(strip $(filter-out > arm%-linux,$(arch)-$(osys)) $(if $(findstring eabi,$(word > 4,$(targ))),,$(word 4,$(targ)))),) > > From the description, I understand that change to mean any ARM, > Linux-kernel, EABI configuration with any kind of user-land, so my > new interpretation seems correct, and the current code wrong to > also accept plain arm-*-linux. That change just cite should just > have replaced linux-gnueabi with linux-%eabi? > >> (perhaps linux-%eabi would be more readable). > > As soon as we've clarified the previous question, I'll do that > change. Thanks. >> However, it seems that the first androideabi snippet was dead >> code. Can you delete it in a follow-up? > > That has been added in commit > 7a5ee35f18bc945ec8abbcd1377c446352504e6e (r193238): > > 2012-11-06 Arnaud Charlet <char...@adacore.com> > > [...] * gcc-interface/Makefile.in: Add runtime pairs for Android. > Rework handling of s-oscons.ads. * s-osinte-android.ads, > s-osinte-android.adb: New files. > > +ifeq ($(strip $(filter-out arm% linux-androideabi,$(arch) > $(osys)-$(word 4,$(targ)))),) + LIBGNAT_TARGET_PAIRS = \ + [...] > + s-osinte.adb<s-osinte-android.adb \ + > s-osinte.ads<s-osinte-android.ads \ + [...] > > Indeed I agree that the second snippet in the Makefile.in (as > changed by Matthias on 2012-10-15) triggers anytime the first one > (as added by Arnaud on 2012-11-06) triggered, so Arnaud's > LIBGNAT_TARGET_PAIRS setting will always be overwritten by > Matthias', so to speak, and thus the new s-osinte-android.* files > never be used in the current code. Arnaud, Matthias, please > clarify the intended behavior? Of course I would assume that for > *-android* configurations the new s-osinte-android.* files be used, > but as Arnaud's change has gone in after Matthias', so this can > never have worked (unless I'm confused)? I think it is an unintended conflict, but then I'd leave it to Arnaud to move the second snippet after the first. (This shows that, in such a conversion to bash case statements, the order should be reversed). Paolo -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJRpv8VAAoJEBvWZb6bTYbydrAP/2l4gMGykKZGtqbj+/9ta0jm IlKJ3tZ1u8LupMX75Rb6l7Cx3268WLoAZY1gGceQZuSWX6cD1KNkHR8uMEsgXwmR WAyRmp8m0FXcQEGC2rdUvRmV0OXIJU/EWhNGiH70pCxteLR8z3/rFAlRUNXGko/o 1od0RaR2jlT2+EBNaKE6PwMdFG94b0qeXEEpFy3/f7jr/5e+E5tcq1YuMg06xs6Q xMIG9QyQlUUbR5o/1J4MVdDGbL0APqMm/E0R7aUsGHpNFBdn2hurEvVx72ZWWXv/ loEBDIkiNQAdv0JGRSJ+NhreoyZbbRXHzZnMXc0coQyLe+wmn396MAWaCadF7Vie lKXN0HRUHTHzeroZPExxOvcXWx/+orgZLlXMMdC/jG3oGiouNQnEuJbKul53hmWz VD1g7gCDyvZBaksFfZcV9GKQKbstf0y4ONOSJP2MyqIhLAzDLy59winv9ph95ymM B/DFN+u3XWMIh0LV4+ngL2afhRpbLyhP0BOzrnNqiJ5fB9RiRhEHXJ4VCnMongB2 DAX2Fw2bsqKgJDi5pKesvXpozyAou2rRi+MQPKvkuHSI5xMg0w1qMgmesoLugPEu Z1vMAr8Hx76l8435or3R5yVAZaTKBGrLKZ/ZH+I9btiukG0jfXyEpGmKZXvN1kgE 1Xzwose5CFQk5OnZLYXZ =NsI2 -----END PGP SIGNATURE-----