Bug 235289 - comms/ncid: fix build with GCC-based architectures
Summary: comms/ncid: fix build with GCC-based architectures
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: Vinícius Zavam
Keywords: patch
Depends on:
Reported: 2019-01-29 08:25 UTC by Piotr Kubaj
Modified: 2019-01-30 09:11 UTC (History)
5 users (show)

See Also:
egypcio: maintainer-feedback+

patch (511 bytes, patch)
2019-01-29 08:25 UTC, Piotr Kubaj
no flags Details | Diff
comms/ncid: fix build with GCC-based architectures (5.82 KB, patch)
2019-01-29 12:39 UTC, Vinícius Zavam
egypcio: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Kubaj freebsd_committer 2019-01-29 08:25:37 UTC
Created attachment 201497 [details]

Base GCC doesn't support -Wno-stringop-truncation. Remove it when base GCC is used.

Tested on powerpc64 and amd64.

Hardware sponsored by IntegriCloud.
Comment 1 Vinícius Zavam freebsd_committer 2019-01-29 10:58:04 UTC
(In reply to Piotr Kubaj from comment #0)

hey, hi. many thanks for reporting it! appreciated :)

I should test it in a few and write back a definitive feedback. ty again.
Comment 2 Vinícius Zavam freebsd_committer 2019-01-29 11:08:01 UTC
quick question: should the ARCH be checked, instead of the existing lib? - GCC is not part of base system for amd64/i386, so that should match only ppc64. right?

PS: should you provide any extra patch, please remember to bump the PORTREVISION and try to use 'svn diff' to generate it.

PPS: 'svn diff --diff-cmd=diff -x -U99999 > /tmp/mypatchfile.diff'

thank you again!
Comment 3 Piotr Kubaj freebsd_committer 2019-01-29 11:24:16 UTC
(In reply to Vinícius Zavam from comment #2)
We could try matching ARCH, but since GCC architectures may move to Clang in the future, this would need to be changed.

Checking for libstdc++ is safe against future errors. Bumping PORTREVISION is not necessary, because there's no change for Clang architectures and it's a build fix for GCC architectures (this port currently doesn't build on them).

I used svn to generate this diff:
root@talos:$/usr/ports/comms/ncid$ svnlite diff
Index: Makefile
--- Makefile    (revision 491546)
+++ Makefile    (working copy)
@@ -59,6 +59,10 @@
                -e 's|$$(prefix)/share|$${PREFIX}/share|g' \
                -e 's|$$(SHARE)/man|$${MANPREFIX}/man/|g' \
                -e 's|$$(SHARE)/ncid|$${DATADIR}|g' ${WRKSRC}/Makefile
+.if exists(/usr/lib/libstdc++.so)
+       @${REINPLACE_CMD} -e 's|-Wno-stringop-truncation||g' \
+               ${WRKSRC}/Makefile ${WRKSRC}/server/Makefile

        @${MKDIR} ${STAGEDIR}${ETCDIR}
Comment 4 Vinícius Zavam freebsd_committer 2019-01-29 12:36:57 UTC
(In reply to Piotr Kubaj from comment #3)

fair point indeed, regarding the GCC in base! :)

I mentioned the 'svn diff' before meaning that patches should be made in the PORTSDIR (ports' root directory, like /usr/ports) and with extra context (using '--diff-cmd=diff -x -U99999').

also, I finished the testport routines for this one: after the applied patch being merged it built just fine for amd64, armv6 and i386 on 11.2, 12.0 and HEAD.

we shall wait a bit to get my mentors approval, and I can push it to the repo.

thank you again Piotr!

Comment 5 Vinícius Zavam freebsd_committer 2019-01-29 12:39:04 UTC
Created attachment 201503 [details]
comms/ncid: fix build with GCC-based architectures

attaching proposed merge here.

# svn diff --diff-cmd=diff -x -U99999 > ports_r491553_PATCH__comms_ncid.diff
Comment 6 Rene Ladan freebsd_committer 2019-01-29 21:36:35 UTC
Comment 7 commit-hook freebsd_committer 2019-01-30 08:57:17 UTC
A commit references this bug:

Author: egypcio
Date: Wed Jan 30 08:56:13 UTC 2019
New revision: 491610
URL: https://svnweb.freebsd.org/changeset/ports/491610

  comms/ncid: fix build with GCC-based architectures

  PR:		235289
  Reported by:	Piotr Kubaj <pkubaj % anongoth.pl>
  Approved by:	rene (mentor)
  Sponsored by:	IntegriCloud

Comment 8 Vinícius Zavam freebsd_committer 2019-01-30 09:11:49 UTC
Committed! Thanks to you and IntegriCloud :)