Bug 238538 - devel/elfutils: fails to build with GCC 9+: libelfP.h:47:30: error: '__elf32_msize' specifies less restrictive attribute
Summary: devel/elfutils: fails to build with GCC 9+: libelfP.h:47:30: error: '__elf32_...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: Tobias Kortkamp
URL:
Keywords:
Depends on:
Blocks: 238330
  Show dependency treegraph
 
Reported: 2019-06-13 06:29 UTC by Gerald Pfeifer
Modified: 2019-07-01 14:56 UTC (History)
1 user (show)

See Also:
cem: maintainer-feedback+


Attachments
elfutils.diff (1.97 KB, patch)
2019-07-01 08:26 UTC, Tobias Kortkamp
tobik: maintainer-approval? (cem)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gerald Pfeifer freebsd_committer freebsd_triage 2019-06-13 06:29:54 UTC
Building elfutils with GCC 9 instead of older versions results in on
amd64 platforms:

In file included from ../config.h:132,
                 from elf32_fsize.c:31:
libelfP.h:47:30: error: '__elf32_msize' specifies less restrictive attribute than its target 'elf32_fsize': 'const' [-Werror=missing-attributes]
   47 | #define __elfw2_(Bits, Name) __elf##Bits##_##Name
      |                              ^~~~~

This currently blocks the update of GCC_DEFAULT to that newer version,
cf. PR 238330.


Logs at

http://package22.nyi.freebsd.org/data/112amd64-default-PR238330/2019-06-09_20h29m30s/logs/errors/elfutils-0.174_2.log

http://package18.nyi.freebsd.org/data/120amd64-default-PR238330/2019-06-09_20h26m27s/logs/errors/elfutils-0.174_2.log


https://gcc.gnu.org/gcc-9/porting_to.html and the general release notes
https://gcc.gnu.org/gcc-9/changes.html may prove useful.
Comment 1 Tobias Kortkamp freebsd_committer freebsd_triage 2019-07-01 08:26:27 UTC
Created attachment 205449 [details]
elfutils.diff

- Cherry pick upstream commit be8080bdd746ac2b07fb0bcad23a9677844bb200 [1]
  to fix build with GCC 9

[1] https://sourceware.org/git/?p=elfutils.git;a=commitdiff;h=be8080bdd746ac2b07fb0bcad23a9677844bb200
Comment 2 Conrad Meyer freebsd_committer freebsd_triage 2019-07-01 12:37:30 UTC
No objection to backporting an upstream fix. Thanks!
Comment 3 Tobias Kortkamp freebsd_committer freebsd_triage 2019-07-01 14:55:15 UTC
Committed, thanks!
Comment 4 commit-hook freebsd_committer freebsd_triage 2019-07-01 14:56:02 UTC
A commit references this bug:

Author: tobik
Date: Mon Jul  1 14:55:02 UTC 2019
New revision: 505576
URL: https://svnweb.freebsd.org/changeset/ports/505576

Log:
  devel/elfutils: Fix build with GCC 9

  In file included from ../config.h:132,
                   from elf32_fsize.c:31:
  libelfP.h:47:30: error: '__elf32_msize' specifies less restrictive attribute than its target 'elf32_fsize': 'const' [-Werror=missing-attributes]
     47 | #define __elfw2_(Bits, Name) __elf##Bits##_##Name
        |                              ^~~~~

  http://package22.nyi.freebsd.org/data/112amd64-default-PR238330/2019-06-09_20h29m30s/logs/errors/elfutils-0.174_2.log

  Cherry pick upstream commit be8080bdd746ac2b07fb0bcad23a9677844bb200

  PR:		238538
  Submitted by:	tobik
  Reported by:	gerald, antoine (via exp-run)
  Approved by:	cem (maintainer)

Changes:
  head/devel/elfutils/Makefile
  head/devel/elfutils/files/patch-git_be8080bdd746