Bug 273037 - lang/sdcc: Fix build if binutils is installed
Summary: lang/sdcc: Fix build if binutils is installed
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Li-Wen Hsu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-10 04:15 UTC by Daniel O'Connor
Modified: 2023-08-15 02:03 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (darius)


Attachments
Patch to fix build (3.34 KB, patch)
2023-08-10 04:15 UTC, Daniel O'Connor
doconnor: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel O'Connor 2023-08-10 04:15:23 UTC
Created attachment 243996 [details]
Patch to fix build

binutils has ansidecls.h which gets picked up before the sdcc version which breaks the build.
Patch the files which use it to use a relative path.

Reported by: Holm Tiffe <holm@freibergnet.de>
Comment 1 Li-Wen Hsu freebsd_committer freebsd_triage 2023-08-10 07:46:44 UTC
(In reply to Daniel O'Connor from comment #0)
I got this error when building in poudriere: https://gist.github.com/lwhsu/dbe061a8f9f317086722125915954241

Can you help checking this?
Comment 2 Daniel O'Connor 2023-08-10 22:22:33 UTC
Hi Li-Wen,
That is very odd, I don't understand why my patch would have affected it including bfd.h..

There is a bfd.h in the source but I don't see how it would get found by asxxxx.c - all very confusing.

I will take a look but it seems like a tricky problem.
Comment 3 Daniel O'Connor 2023-08-14 03:36:16 UTC
Hi Li-Wen,
I've tried to reproduce the problem but I can't make it fail for me - unfortunately I don't have a Poudriere setup.


I tried moving my bfd.h out of the way but it still builds fine.
Also I just can't see how my changes would affect the build in that way.

If you build the original port without my current patches does it work?
Comment 4 Li-Wen Hsu freebsd_committer freebsd_triage 2023-08-14 18:52:48 UTC
(In reply to Daniel O'Connor from comment #3)
Weird, I updated my ports tree and test again, with and without the patch and now both are fine.  I'm sorry for the noise and I'll handle this soon.
Comment 5 Li-Wen Hsu freebsd_committer freebsd_triage 2023-08-14 19:03:39 UTC
Daniel, the MAINTAINER field of this port is darius AT dons.net.au while this ticket is submitted by (and the maintainer-approval flag is set by) doconnor AT gsoft.com.au. From the name I can tell these should belong to the same person, but to be more formal, can you use the account of the actual maintainer, who submitted bug 246714, to verify this?

BTW if you want to change email for the account, we can do accounts merging for you.
Comment 6 Daniel O'Connor 2023-08-14 23:22:41 UTC
Comment on attachment 243996 [details]
Patch to fix build

<changes hats>
Comment 7 Li-Wen Hsu freebsd_committer freebsd_triage 2023-08-15 01:42:04 UTC
Committed and pushed. While here, fixed some minor `portlint -abct` warnings.
Comment 8 commit-hook freebsd_committer freebsd_triage 2023-08-15 01:42:20 UTC
A commit in branch main references this bug:

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

commit f565698366db8cb2e990f24346416c3f9bf2d0de
Author:     Daniel O'Connor <doconnor@gsoft.com.au>
AuthorDate: 2023-08-15 01:40:43 +0000
Commit:     Li-Wen Hsu <lwhsu@FreeBSD.org>
CommitDate: 2023-08-15 01:40:43 +0000

    lang/sdcc: Fix build if binutils is installed

    binutils has ansidecls.h which gets picked up before the sdcc version
    which breaks the build.  Patch the files which use it to use a relative
    path.

    PR:             273037

 lang/sdcc/Makefile                                            |  2 +-
 .../files/patch-support_sdbinutils_libiberty_objalloc.c (new) | 11 +++++++++++
 .../files/patch-support_sdbinutils_libiberty_spaces.c (new)   | 11 +++++++++++
 .../files/patch-support_sdbinutils_libiberty_xatexit.c (new)  | 11 +++++++++++
 .../files/patch-support_sdbinutils_libiberty_xmalloc.c (new)  | 11 +++++++++++
 .../files/patch-support_sdbinutils_libiberty_xmemdup.c (new)  | 11 +++++++++++
 6 files changed, 56 insertions(+), 1 deletion(-)
Comment 9 Daniel O'Connor 2023-08-15 02:03:52 UTC
Thanks Li-Wen