Bug 233335 - install(1) prints warnings for go-built executables: strip: moving loadable section .noptrbss, is this intentional?
Summary: install(1) prints warnings for go-built executables: strip: moving loadable s...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 11.2-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-19 18:30 UTC by Yuri Victorovich
Modified: 2019-11-16 16:31 UTC (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer freebsd_triage 2018-11-19 18:30:14 UTC
Testcase: the port dns/amass

Ports framework recommends ${INSTALL_PROGRAM} to be used to install elf programs.
INSTALL_PROGRAM resolves to 'install -s -m 555'.

install(1) prints warnings:
> ===>   Generating temporary packing list
> install  -s -m 555 /usr/ports/dns/amass/work/amass-2.8.3-4-g935e6d5_GH0/bin/amass /usr/ports/dns/amass/work/stage/usr/local/bin
> strip: moving loadable section .noptrbss, is this intentional?
> install  -s -m 555 /usr/ports/dns/amass/work/amass-2.8.3-4-g935e6d5_GH0/bin/amass.db /usr/ports/dns/amass/work/stage/usr/local/bin
> strip: moving loadable section .noptrbss, is this intentional?
> install  -s -m 555 /usr/ports/dns/amass/work/amass-2.8.3-4-g935e6d5_GH0/bin/amass.netdomains /usr/ports/dns/amass/work/stage/usr/local/bin
> strip: moving loadable section .noptrbss, is this intentional?
> install  -s -m 555 /usr/ports/dns/amass/work/amass-2.8.3-4-g935e6d5_GH0/bin/amass.viz /usr/ports/dns/amass/work/stage/usr/local/bin
> strip: moving loadable section .noptrbss, is this intentional?
Comment 1 Ed Maste freebsd_committer freebsd_triage 2019-03-18 19:55:17 UTC
Can you attach (the unstripped) bin/amass to this PR or store it somewhere and link it here?
Comment 2 Yuri Victorovich freebsd_committer freebsd_triage 2019-03-18 20:49:10 UTC
https://people.freebsd.org/~yuri/amass
Comment 3 Dmitri Goutnik freebsd_committer freebsd_triage 2019-04-03 19:25:58 UTC
One possible workaround would be to avoid stripping Go-built executables during install and omit symbol table and debug information during link instead (with -ldflags="-s -w" go build flag) [1]

For ports that use USES=go this could be done on ports framework level (unless WITH_DEBUG specified)

[1] https://golang.org/cmd/link/
Comment 4 Mateusz Piotrowski freebsd_committer freebsd_triage 2019-05-15 10:15:23 UTC
(In reply to Dmitri Goutnik from comment #3)

I am experiencing the same behavior when building textproc/markdownfmt.
Comment 5 Mateusz Piotrowski freebsd_committer freebsd_triage 2019-09-20 13:16:54 UTC
(In reply to Dmitri Goutnik from comment #3)
Do you think that we could included something in the framework to address those warnings?
Comment 6 Dmitri Goutnik freebsd_committer freebsd_triage 2019-09-20 14:59:47 UTC
https://reviews.freebsd.org/D21730
Comment 7 commit-hook freebsd_committer freebsd_triage 2019-11-16 12:40:09 UTC
A commit references this bug:

Author: dmgk
Date: Sat Nov 16 12:39:25 UTC 2019
New revision: 517743
URL: https://svnweb.freebsd.org/changeset/ports/517743

Log:
  Mk/Uses/go.mk: Omit symbol table and debug information by default

  PR:		233335
  Reported by:	yuri
  Reviewed by:	0mp, tobik
  Approved by:	araujo (mentor)
  Differential Revision:	https://reviews.freebsd.org/D21730

Changes:
  head/Mk/Uses/go.mk