Bug 258678 - [PATCH] devel/llvm* fails to build following df8dd6025af8 on 14-CURRENT
Summary: [PATCH] devel/llvm* fails to build following df8dd6025af8 on 14-CURRENT
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: Brooks Davis
URL: https://reviews.freebsd.org/D32060
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-22 13:43 UTC by Cy Schubert
Modified: 2021-09-23 12:57 UTC (History)
2 users (show)

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


Attachments
Fix llvm10 build (564 bytes, patch)
2021-09-22 13:43 UTC, Cy Schubert
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cy Schubert freebsd_committer 2021-09-22 13:43:04 UTC
The following error occurs after 14-CURRENT df8dd6025af8.


 [ 15% 159/1012] Building CXX object lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.i386.dir/sanitizer_procmaps_bsd.cpp.o
FAILED: lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.i386.dir/sanitizer_procmaps_bsd.cpp.o 
/usr/local/libexec/ccache/c++ -DHAVE_RPC_XDR_H=0 -I/wrkdirs/usr/ports/devel/llvm10/work/compiler-rt-10.0.1.src/lib/sanitizer_common/.. -O2 -pipe -Wno-misleading-indentation -Wno-tautological-overlap-compare -DNDEBUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -DNDEBUG -isystem /usr/local/include -Wall -std=c++14 -Wno-unused-parameter -O2 -pipe -Wno-misleading-indentation -Wno-tautological-overlap-compare -DNDEBUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -DNDEBUG -isystem /usr/local/include  -m32 -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fno-sanitize=safe-stack -fvisibility=hidden -fno-lto -O3 -gline-tables-only -Wno-gnu -Wno-variadic-macros -Wno-c99-extensions -Wno-non-virtual-dtor -fno-rtti -Wframe-larger-than=570 -Wglobal-constructors -DSANITIZER_SUPPORTS_WEAK_HOOKS=0 -MD -MT lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.i386.dir/sanitizer_procmaps_bsd.cpp.o -MF lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.i386.dir/sanitizer_procmaps_bsd.cpp.o.d -o lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.i386.dir/sanitizer_procmaps_bsd.cpp.o -c /wrkdirs/usr/ports/devel/llvm10/work/compiler-rt-10.0.1.src/lib/sanitizer_common/sanitizer_procmaps_bsd.cpp
In file included from /wrkdirs/usr/ports/devel/llvm10/work/compiler-rt-10.0.1.src/lib/sanitizer_common/sanitizer_procmaps_bsd.cpp:27:
In file included from /usr/include/sys/user.h:51:
In file included from /usr/include/sys/proc.h:75:
/usr/include/machine/proc.h:78:2: error: use of 'savefpu' with tag type that does not match previous declaration
        struct savefpu *md_usr_fpu_save;
        ^
/usr/include/x86/fpu.h:127:7: note: previous use is here
union savefpu {
      ^
1 error generated.
[ 15% 159/1012] Building CXX object lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.i386.dir/sanitizer_solaris.cpp.o
[ 15% 159/1012] Building CXX object lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.i386.dir/sanitizer_rtems.cpp.o
[ 15% 159/1012] Building CXX object lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.i386.dir/sanitizer_tls_get_addr.cpp.o
[ 15% 159/1012] Building CXX object lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.i386.dir/sanitizer_stoptheworld_mac.cpp.o
[ 15% 159/1012] Building CXX object lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.i386.dir/sanitizer_suppressions.cpp.o
ninja: build stopped: subcommand failed.
*** Error code 1

Stop.
make: stopped in /usr/ports/devel/llvm10
=>> Cleaning up wrkdir
===>  Cleaning for llvm10-10.0.1_7
Comment 1 Cy Schubert freebsd_committer 2021-09-22 13:43:57 UTC
Created attachment 228121 [details]
Fix llvm10 build

And now the patch.
Comment 2 Cy Schubert freebsd_committer 2021-09-22 16:12:17 UTC
devel/llvm9 suffers the same problem and needs the same patch.

[ 15% 159/1007] Building CXX object lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.i386.dir/sanitizer_procmaps_bsd.cc.o
FAILED: lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.i386.dir/sanitizer_procmaps_bsd.cc.o 
/usr/local/libexec/ccache/c++ -DHAVE_RPC_XDR_H=0 -I/wrkdirs/usr/ports/devel/llvm90/work/compiler-rt-9.0.1.src/lib/sanitizer_common/.. -O2 -pipe -Wno-misleading-indentation -Wno-tautological-overlap-compare -DNDEBUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -DNDEBUG -isystem /usr/local/include -Wall -std=c++11 -Wno-unused-parameter -O2 -pipe -Wno-misleading-indentation -Wno-tautological-overlap-compare -DNDEBUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -DNDEBUG -isystem /usr/local/include  -m32 -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fno-sanitize=safe-stack -fvisibility=hidden -fno-lto -O3 -gline-tables-only -Wno-gnu -Wno-variadic-macros -Wno-c99-extensions -Wno-non-virtual-dtor -fno-rtti -Wframe-larger-than=570 -Wglobal-constructors -DSANITIZER_SUPPORTS_WEAK_HOOKS=0 -MD -MT lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.i386.dir/sanitizer_procmaps_bsd.cc.o -MF lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.i386.dir/sanitizer_procmaps_bsd.cc.o.d -o lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.i386.dir/sanitizer_procmaps_bsd.cc.o -c /wrkdirs/usr/ports/devel/llvm90/work/compiler-rt-9.0.1.src/lib/sanitizer_common/sanitizer_procmaps_bsd.cc
In file included from /wrkdirs/usr/ports/devel/llvm90/work/compiler-rt-9.0.1.src/lib/sanitizer_common/sanitizer_procmaps_bsd.cc:27:
In file included from /usr/include/sys/user.h:51:
In file included from /usr/include/sys/proc.h:75:
/usr/include/machine/proc.h:78:2: error: use of 'savefpu' with tag type that does not match previous declaration
        struct savefpu *md_usr_fpu_save;
        ^
/usr/include/x86/fpu.h:127:7: note: previous use is here
union savefpu {
      ^
1 error generated.
[ 15% 159/1007] Building CXX object lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.i386.dir/sanitizer_win.cc.o
[ 15% 159/1007] Building CXX object lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.i386.dir/sanitizer_type_traits.cc.o
[ 15% 159/1007] Building CXX object lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.i386.dir/sanitizer_tls_get_addr.cc.o
[ 15% 159/1007] Building CXX object lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.i386.dir/sanitizer_thread_registry.cc.o
[ 15% 159/1007] Building CXX object lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.i386.dir/sanitizer_suppressions.cc.o
ninja: build stopped: subcommand failed.
*** Error code 1

Stop.
make: stopped in /usr/ports/devel/llvm90
Comment 3 commit-hook freebsd_committer 2021-09-22 20:20:02 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=e36d0e86e3282cde5a12b6a623e6deefaabfd0c4

commit e36d0e86e3282cde5a12b6a623e6deefaabfd0c4
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-09-22 18:54:39 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2021-09-22 20:17:47 +0000

    Revert "linux32: add a hack to avoid redefining the type of the savefpu tag"

    This reverts commit 0f6829488ef32142b9ea1c0806fb5ecfe0872c02.
    Also it changes the type of md_usr_fpu_save struct mdthread member
    to void *, which is what uncovered this trouble.  Now the save area
    is untyped, but since it is hidden behind accessors, it is not too
    significant.  Since apparently there are consumers affected outside
    the tree, this hack is better than one from the reverted revision.

    PR:     258678
    Reported by:    cy
    Reviewed by:    cy, kevans, markj
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D32060

 sys/amd64/include/proc.h   | 2 +-
 sys/modules/linux/Makefile | 2 +-
 sys/x86/include/fpu.h      | 2 --
 3 files changed, 2 insertions(+), 4 deletions(-)
Comment 4 Cy Schubert freebsd_committer 2021-09-23 12:57:38 UTC
The problem has been fixed.