Bug 274238 - Mk/Uses/ada.mk: Setting CC to gnatmake is wrong, use gcc instead
Summary: Mk/Uses/ada.mk: Setting CC to gnatmake is wrong, use gcc instead
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Robert Clausecker
URL:
Keywords:
Depends on:
Blocks: 274243
  Show dependency treegraph
 
Reported: 2023-10-03 13:39 UTC by Nico Sonack
Modified: 2023-10-19 07:15 UTC (History)
5 users (show)

See Also:
bugzilla: maintainer-feedback?


Attachments
Fix for CC/GNATMAKE (869 bytes, patch)
2023-10-03 13:39 UTC, Nico Sonack
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nico Sonack 2023-10-03 13:39:22 UTC
Created attachment 245404 [details]
Fix for CC/GNATMAKE

When setting USES=ada:12 CC gets set to gnatmake. This is wrong as it breaks build systems where CC needs to build single C objects. E.g.: https://poudriere.herrhotzenplotz.de/data/release-latest-main/2023-09-30_20h57m21s/logs/errors/ghdl-3.0.0_2.log

This patch instead sets CC to gcc and GNATMAKE to gnatmake.

I needed to do this in order to get cad/ghdl to build with lang/gnat12.
I have not tested this with any other ports but I assume that this was a hack for some other port.
Therefore ports that depend on this hack may need to be patched separately, the current USES ada.mk is simply wrong.

I will cross-link the bugs related to this later as I submit them.

NOTE: I had to file the bug in "Individual Ports" because the submission form doesn't allow me to file bugs for the ports framework. Who knows...
Comment 1 Nico Sonack 2023-10-03 14:10:52 UTC
See follow up here: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=274239
Comment 2 Yuri Victorovich freebsd_committer freebsd_triage 2023-10-07 05:04:39 UTC
I don't know much about Ada, so I am a wrong person to be assigned.
Comment 3 Robert Clausecker freebsd_committer freebsd_triage 2023-10-16 15:59:30 UTC
Could we get an exp-run for all consumers of USES=ada for this one?  (thanks to meena for the suggestion)

I do not know enough about ada to judge this patch, but it looks reasonable and if it doesn't break anything, it's probably fine.
Comment 4 Antoine Brodin freebsd_committer freebsd_triage 2023-10-16 16:07:28 UTC
There are less than 10 users of USES=ada, not enough for an exp-run.
You can test yourself.
Comment 5 Robert Clausecker freebsd_committer freebsd_triage 2023-10-16 18:59:59 UTC
Okay.  Will commit if all ports with USES=ada build succesfully.
Comment 6 Alastair Hogge 2023-10-16 23:18:30 UTC
I think the test needs to be done with "USES=ada:12".

I am currently waiting on poudriere-testport to complete against devel/matreshka and devel/alire, with the attached patch.
Comment 7 Alastair Hogge 2023-10-17 00:02:18 UTC
devel/matreshka: 12.4, 13.2, and main on amd64 poudriere-testport OK
devel/alire    : 12.4, 13.2, and main on amd64 poudriere-testport OK
Comment 8 commit-hook freebsd_committer freebsd_triage 2023-10-19 07:09:24 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=5b5f129463d4d119478e0ff5ca613b7d29edfe53

commit 5b5f129463d4d119478e0ff5ca613b7d29edfe53
Author:     Nico Sonack <nsonack@herrhotzenplotz.de>
AuthorDate: 2023-10-01 17:01:26 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-10-19 07:07:28 +0000

    Mk/Uses/ada.mk: Don't set CC to gnatmake but to gcc

    Setting CC to gnatmake breaks compiling simple C objects. Instead
    set it to the correct compiler frontend and set GNATMAKE to gnatmake.

    Signed-off-by:  Nico Sonack <nsonack@herrhotzenplotz.de>
    PR:             274238

 Mk/Uses/ada.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Comment 9 Robert Clausecker freebsd_committer freebsd_triage 2023-10-19 07:15:11 UTC
Thank you for your contribution.