Bug 211154 - Mk/bsd.gcc.mk: add support for build-only dependencies for USE_GCC
Summary: Mk/bsd.gcc.mk: add support for build-only dependencies for USE_GCC
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Gerald Pfeifer
URL: https://reviews.freebsd.org/D7223
Keywords: feature, needs-qa, patch
: 199897 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-07-16 12:34 UTC by Fabian Freyer
Modified: 2018-12-30 01:44 UTC (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Freyer 2016-07-16 12:34:18 UTC
Several ports use USE_GCC but  manually remove gcc from RUN_DEPENDS by using RUN_DEPENDS:=${RUN_DEPENDS:Ngcc*} after after including bsd.port.mk:
* sysutils/memtest86+
* sysutils/grub2-bhyve
* sysutils/grub2-pcbsd
* sysutils/grub2-efi
* misc/seabios

This is a very hacky approach.

There are several other ports (e.g. sysutils/uefi-edi2-bhyve) that have a build-time dependency on gcc but do not depend on it at run-time.

Therefore support for adding a build-time dependency e.g. by setting USE_GCC=yes:build or similar would be very useful.
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2016-07-16 12:40:20 UTC
A patch exists in bug 155408 that didn't received an example port showing usage. 

It probably needs a second version created to account for modern framework design, but nonetheless is a reference
Comment 2 Roman Bogorodskiy freebsd_committer 2016-07-16 12:45:48 UTC
Here's a review request I created for that: https://reviews.freebsd.org/D7173
Comment 3 Fabian Freyer 2016-07-16 13:53:57 UTC
Based on the patch by novel@ and how Mk/Uses/python.mk does it, I've created review D7223
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2016-07-17 08:37:15 UTC
+1 on D7223
Comment 5 Kubilay Kocak freebsd_committer freebsd_triage 2016-07-21 11:36:20 UTC
D7173 has been closed
Comment 6 Gerald Pfeifer freebsd_committer 2016-07-25 19:36:35 UTC
Thanks for doing this!  While I am currently not fully available
for FreeBSD work, I quite support the idea behind this and just
reviewed the patch on reviews.FreeBSD.org.

Once it is approved there, please go ahead and commit.  (Might it
make sense for you to assign this PR to yourself?)
Comment 7 Gerald Pfeifer freebsd_committer 2017-01-15 21:46:15 UTC
*** Bug 199897 has been marked as a duplicate of this bug. ***
Comment 8 Pedro F. Giffuni freebsd_committer 2017-01-16 04:11:42 UTC
+1
It looks like a very practical solution.

Does fortran also involve a runtime library? Just wondering on anything that depends on, for example, blas.
Comment 9 commit-hook freebsd_committer 2017-11-02 20:32:53 UTC
A commit references this bug:

Author: tobik
Date: Thu Nov  2 20:31:53 UTC 2017
New revision: 453376
URL: https://svnweb.freebsd.org/changeset/ports/453376

Log:
  net/ipxe: Update to latest commit

  iPXE naturally doesn't require or link with any of the libraries
  provided by GCC, so remove the GCC run dependency.  In the absence of
  a better solution to do this we use the hack used by other ports like
  devel/linux-kernel, sysutils/memtest86+, sysutils/grub2-bhyve,
  misc/seabios, ... [1]

  Changes:	https://github.com/ipxe/ipxe/compare/26050fd4c87c50503d5bd573b2ec91703676e211...1b67a0564657b6fcef18b1588ea6491ca1b1996d
  PR:		211154 [1]

Changes:
  head/net/ipxe/Makefile
  head/net/ipxe/distinfo
Comment 10 commit-hook freebsd_committer 2018-03-10 10:08:34 UTC
A commit references this bug:

Author: tobik
Date: Sat Mar 10 10:07:46 UTC 2018
New revision: 464059
URL: https://svnweb.freebsd.org/changeset/ports/464059

Log:
  sysutils/uefi-edk2-bhyve: Remove GCC run dependency

  The firmware does not require or link with any of the libraries
  provided by GCC, so remove the GCC run dependency.

  Due to the lack of an accepted better solution in bsd.gcc.mk to do
  this, we use the hack used by other ports like devel/linux-kernel,
  sysutils/memtest86+, sysutils/grub2-bhyve, misc/seabios, net/ipxe, ...

  PR:		211079, 211154
  Approved by:	Process paralysis

Changes:
  head/sysutils/uefi-edk2-bhyve/Makefile