Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • CMake CMake
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 4,108
    • Issues 4,108
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 19
    • Merge requests 19
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMakeCMake
  • CMakeCMake
  • Issues
  • #21469
Closed
Open
Issue created Nov 19, 2020 by xkszltl@xkszltl

LANGUAGE property behavior change in CMake 3.19.0 breaks LLVM build

I'm building LLVM 11.0.0 (and almost all sub-projects, i.e. clang/compiler-rt/libcxx/openmp/...). It worked with CMake 3.18.4 but hit compiling error after upgrading to 3.19.0.

FAILED: projects/compiler-rt/lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/rtl/tsan_rtl_amd64.S.o
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/local/bin/ccache /usr/bin/gcc-8 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Iprojects/compiler-rt/lib/tsan -I/tmp/scratch/llvm/compiler-rt/lib/tsan -Iinclude -I/tmp/scratch/llvm/llvm/include -I/tmp/scratch/llvm/compiler-rt/lib/tsan/.. -x c -fdebug-prefix-map='/tmp/scratch'='/usr/local/src' -fPIC -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections -Wall -Wno-unused-parameter -O3 -DNDEBUG  -m64 -fno-lto -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fvisibility=hidden -fno-lto -O3 -g -Wno-variadic-macros -Wno-non-virtual-dtor -fPIE -fno-rtti -msse3 -Wframe-larger-than=530 --sysroot=. -MD -MT projects/compiler-rt/lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/rtl/tsan_rtl_amd64.S.o -MF projects/compiler-rt/lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/rtl/tsan_rtl_amd64.S.o.d -o projects/compiler-rt/lib/tsan/CMakeFiles/clang_rt.tsan-x86_64.dir/rtl/tsan_rtl_amd64.S.o -c /tmp/scratch/llvm/compiler-rt/lib/tsan/rtl/tsan_rtl_amd64.S
cc1: warning: command line option â<80><98>-Wno-non-virtual-dtorâ<80><99> is valid for C++/ObjC++ but not for C
cc1: warning: command line option â<80><98>-fno-rttiâ<80><99> is valid for C++/ObjC++ but not for C
/tmp/scratch/llvm/compiler-rt/lib/tsan/rtl/tsan_rtl_amd64.S:7:1: error: expected identifier or â<80><98>(â<80><99> before â<80><98>.â<80><99> token
 .section .text
 ^
/tmp/scratch/llvm/compiler-rt/lib/tsan/rtl/tsan_rtl_amd64.S:16:5: error: invalid preprocessing directive #Save
   # Save scratch registers.
     ^~~~

Sounds like .S are mistakenly treated as .c.

Issue can we stably repro on CentOS 7 + gcc 9 and Ubuntu 18.04 + gcc 8

Full screenshot: image

Edited Nov 23, 2020 by Brad King
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking