| Summary: | Define compilation flags to be used with GPRbuild. | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Pavel Zhukov <pavel> |
| Component: | fedora-gnat-project-common | Assignee: | Björn Persson <bjorn> |
| Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | high | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 14 | CC: | bjorn, vgodunko |
| Target Milestone: | --- | Keywords: | Improvement, Reopened |
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Fixed In Version: | fedora-gnat-project-common-2.2-1.fc15 | Doc Type: | Enhancement |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2011-05-04 16:48:19 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
|
Description
Pavel Zhukov
2011-03-28 20:06:15 UTC
Please separate flags for gnatmake/gprbuild from gcc flags if possible I defined GNAT_optflags by simply removing the one parameter in optflags that Gnatmake didn't like and then adding some Gnat-specific ones that I found useful. If GPRbuild doesn't take the same parameters as Gnatmake, then there should probably be another RPM macro with GPRbuild parameters. I'll look into this, but not this night. You can help by explaining which parameters shouldn't be used, what they do and why they are bad for Ada. %ada_optflags %(echo '%{optflags}' | sed 's/-Wall//' | sed 's/--param=ssp-buffer-size=[0-9]*//g' | sed 's/-pipe//'| sed 's/-Wp\,-D_FORTIFY_SOURCE=2//')
%GNAT_optflags -R -p -XHARDWARE_PLATFORM=%{_arch} -cargs %{ada_optflags}
In /etc/rpm/macros.gnat works for me. But we should add smp_optflags.
I patch Makefile(-s) for gprbuild -Pproject_name ${GNATFLAGS}
I suggest to use -cargs:ada for gprbuild and -cargs for gnatmake. Use of -cargs for gprbuild is not recommended, because specified parameters are passed to all compilers not to GNAT only. As result, gprbuild will can't build mixed languages projects. Björn, Can you add me to co-mointainers of fedora-gnat-project-common ? In order to support multiple languages I suppose we should also include the optflags for C with -cargs:C, and similarly for other languages. Something like this maybe:
%GPRbuild_optflags -cargs:Ada %{Ada_optflags} -cargs:C %{optflags} -cargs:Fortran %{optflags} -gargs -R -p -XHARDWARE_PLATFORM=%{_arch}
The Fortran guidelines require that optflags be used unmodified. Do you guys know if there is a version of optflags adapted for C++?
(In reply to comment #5)
> Can you add me to co-mointainers of fedora-gnat-project-common ?
I'll give you commit access if you apply in the package database, but please discuss with me before you make any nontrivial changes.
Actually it seems like optflags can be used unmodified if prefixed with -cargs. This works for me with both Gnatmake and GPRbuild:
%GNAT_builder_flags %{?_smp_mflags} -R -p -XHARDWARE_PLATFORM=%{_arch}
%GNAT_optflags -cargs %{optflags} -margs %{GNAT_builder_flags}
(I tested it by rebuilding Mine Detector in Fedora 15 on i386, substituting gprbuild for gnatmake in the spec file.)
-Wall is actually documented in the GNAT User's Guide under Switches for gcc. -Wp is of course irrelevant for Ada and -pipe may not do much, but I can't see that they do any harm so writing code to filter them out would just add unnecessary complexity. Thus it currently appears that the same compiler parameters shall be passed for all languages, so -cargs will do for both Gnatmake and GPRbuild. If we need to add any Ada-specific parameters we should use -cargs:Ada for those, but let's not make this more complicated than it needs to be.
fedora-gnat-project-common-2.2-1.fc15 has been submitted as an update for Fedora 15. https://admin.fedoraproject.org/updates/fedora-gnat-project-common-2.2-1.fc15 You miss one important point: gprbuild can be used to any languages, not only for that is come with gcc. It is actually used by several Ada packages (Auto_Text_IO and QtAda are examples) in this way. Package fedora-gnat-project-common-2.2-1.fc15: * should fix your issue, * was pushed to the Fedora 15 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing fedora-gnat-project-common-2.2-1.fc15' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/fedora-gnat-project-common-2.2-1.fc15 then log in and leave karma (feedback). (In reply to comment #9) > You miss one important point: gprbuild can be used to any languages, not only > for that is come with gcc. It is actually used by several Ada packages > (Auto_Text_IO and QtAda are examples) in this way. I'd like to look at the examples. Which file in the QTada source tree should I look at? I don't see any references to GPRbuild in Auto_Text_IO 3.05. I just discovered that moving -g into -cargs causes the binder files to be left out from debuginfo packages because Gnatlink deletes them. I should push another update to pass -g to Gnatlink, but I need to check first what -largs -g does with GPRbuild. fedora-gnat-project-common-2.2-1.fc15 has been pushed to the Fedora 15 stable repository. If problems still persist, please make note of it in this bug report. Just as the beta freeze is lifted and 2.2 is finally pushed to the stable repository, I have submitted 2.3 to get the missing binder files back. I'm also working on a bigger set of changes that includes using -cargs:<language> for GPRbuild. I'll keep this bug open until those changes are done. Version 3.1 is now in Rawhide. It has separate Gnatmake_optflags and GPRbuild_optflags, and should work with compilers that don't understand GCC's parameters. I can make a version 2.4 for Fedora 15 if there's a need to package anything that uses GPRbuild with a non-GCC compiler. Otherwise 2.3 will do for Fedora 15. |