Bug 248755 - lang/gcc7: Fix build with clang 11
Summary: lang/gcc7: Fix build with clang 11
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Gerald Pfeifer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-19 17:16 UTC by Dimitry Andric
Modified: 2020-08-22 10:17 UTC (History)
0 users

See Also:
gerald: maintainer-feedback+


Attachments
lang/gcc7: Fix build with clang 11 (1.11 KB, patch)
2020-08-19 17:16 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2020-08-19 17:16:33 UTC
Created attachment 217344 [details]
lang/gcc7: Fix build with clang 11

With clang 11, imported into base r364284, building lang/gcc7 results in:

/wrkdirs/usr/ports/lang/gcc7/work/gcc-7.5.0/gcc/config/i386/i386.c:9631:8: error: cannot initialize a variable of type 'bool' with an rvalue of type 'nullptr_t'
  bool error_p = NULL;
       ^         ~~~~

Upstream has already fixed this at some point, by replacing 'NULL' with 'false'.
Comment 1 Gerald Pfeifer freebsd_committer freebsd_triage 2020-08-20 05:33:48 UTC
Thank you, Dim!

I did a bit of archeology, and upstream addressed this via

commit 9f36390d429502f0a0dee20bda5b4870da948f6a
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Sat May 6 09:01:51 2017 +0200

    i386.c (ext_80387_constant_init): Do not explicitly initialize to zero.
    
            * config/i386/i386.c (ext_80387_constant_init): Do not explicitly
            initialize to zero.
            (init_regs): Remove declaration.
            (function_arg_advance_32): Initialize error_p as boolean variable.
    
    From-SVN: r247711

Maybe mention that in the patch file?


I'll commit that first thing tomorrow (after some testing); if it
is time sensitive for you, also cool if you want to go ahead with
  Approved-by: gerald (maintainer)

Thanks again!
Comment 2 commit-hook freebsd_committer freebsd_triage 2020-08-22 09:06:38 UTC
A commit references this bug:

Author: gerald
Date: Sat Aug 22 09:06:01 UTC 2020
New revision: 545751
URL: https://svnweb.freebsd.org/changeset/ports/545751

Log:
  Fix the build with clang 11.

  This was fixed upstream as part of a larger commit on May 6th 2017,
  and dim@ now encountered the same and fixed the specific issue for
  our GCC 7 port.  Newer versions should not exhibit this.

  (See the new files/patch-gcc_config_i386_i386.c for more details.)

  PR:		248755
  Submitted by:	dim

Changes:
  head/lang/gcc7/files/patch-gcc_config_i386_i386.c
Comment 3 Gerald Pfeifer freebsd_committer freebsd_triage 2020-08-22 09:09:18 UTC
Thank you dim for the report and patch!

I believe newer versions of lang/gcc* should be okay, but please advise
if there's anything to do there.
Comment 4 Dimitry Andric freebsd_committer freebsd_triage 2020-08-22 10:17:54 UTC
(In reply to Gerald Pfeifer from comment #3)
Yes, I've built these all successfully:

lang/gcc
lang/gcc48
lang/gcc7
lang/gcc8
lang/gcc9
lang/gcc10-devel

Thanks!