Skip to content

"Unable to build LLVM" error with 2023.1 #279

Closed

Description

@MatthewFluet

Version

2023.1 (latest)

Operating System

  • Any
  • Linux
  • macOS
  • Windows
  • Other Unix

OS Version

Fedora 38

Processor

  • Any
  • Arm (using Rosetta)
  • x86-64 (64-bit)
  • Other

System Component

Installation

Severity

Critical

Description

Running the provided build.sh terminates with:

[ 11%] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Signals.cpp.o
In file included from /home/matthew/devel/smlnj/smlnj-2023.1/llvm/src/lib/Support/Signals.cpp:14:
/home/matthew/devel/smlnj/smlnj-2023.1/llvm/src/include/llvm/Support/Signals.h:117:8: error: variable or field ‘CleanupOnSignal’ declared void
  117 |   void CleanupOnSignal(uintptr_t Context);
      |        ^~~~~~~~~~~~~~~
/home/matthew/devel/smlnj/smlnj-2023.1/llvm/src/include/llvm/Support/Signals.h:117:24: error: ‘uintptr_t’ was not declared in this scope
  117 |   void CleanupOnSignal(uintptr_t Context);
      |                        ^~~~~~~~~
/home/matthew/devel/smlnj/smlnj-2023.1/llvm/src/include/llvm/Support/Signals.h:18:1: note: ‘uintptr_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
   17 | #include <string>
  +++ |+#include <cstdint>
   18 | 
[ 11%] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/TargetRegistry.cpp.o
[ 11%] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/ThreadLocal.cpp.o
[ 11%] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Threading.cpp.o
In file included from /home/matthew/devel/smlnj/smlnj-2023.1/llvm/src/lib/Support/Signals.cpp:220:
/home/matthew/devel/smlnj/smlnj-2023.1/llvm/src/lib/Support/Unix/Signals.inc:348:44: error: ‘void llvm::sys::CleanupOnSignal(uintptr_t)’ should have been declared inside ‘llvm::sys’
  348 | void sys::CleanupOnSignal(uintptr_t Context) {
      |                                            ^
[ 11%] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Valgrind.cpp.o
[ 11%] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Watchdog.cpp.o
make[2]: *** [lib/Support/CMakeFiles/LLVMSupport.dir/build.make:1742: lib/Support/CMakeFiles/LLVMSupport.dir/Signals.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:3088: lib/Support/CMakeFiles/LLVMSupport.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

real    1m27.050s
user    5m14.736s
sys     0m17.362s
./build.sh: !!! Unable to build LLVM

I include the full build transcript below, but I didn't see any other meaningful warnings or errors from the ./configure step of LLVM.

Transcript

smlnj-2023.1.build.txt

Expected Behavior

No response

Steps to Reproduce

$ git clone https://github.com/smlnj/smlnj.git
$ cd smlnj
$ curl -O https://smlnj.org/dist/working/2023.1/boot.amd64-unix.tgz
$ ./build.sh -verbose

Additional Information

No response

Email address

Matthew.Fluet@gmail.com

Activity

  1. JohnReppy commented on Dec 14, 2023

    @JohnReppy
    Contributor

    This looks like a difference in C++ compilers (what are you using?). I tested the build on Ubuntu 22 and 20 using clang++ v14 and on macOS using clang++ v15. The fix is probably to add #include <cstdint> at the beginning of the Signals.h header (I assume that it must be getting included via <string> when using clang++).
    Since I do not have access to a Fedora installation, can you please try this fix and let me know if it fixes the issue?

  2. added
    installationproblem with installation
    llvm-codegenissues related to the LLVM-based code generator
    on Dec 14, 2023
  3. self-assigned this
    on Dec 14, 2023
  4. JohnReppy commented on Dec 14, 2023

    @JohnReppy
    Contributor

    Thanks for noticing that; I've fixed it.

  5. MatthewFluet commented on Dec 14, 2023

    @MatthewFluet
    Author

    I have clang++ v16 installed.

    I tried adding #include <cstdint> to Signals.h and the LLVM build is getting further.

  6. MatthewFluet commented on Dec 14, 2023

    @MatthewFluet
    Author

    With that change, the build did complete.

    I get the fgrep: warning: fgrep is obsolescent; using grep -F warning that was reported in smlnj/legacy#286 and reported as fixed in smlnj/legacy@1346e96, which seems not to have been ported.

  7. JohnReppy commented on Dec 15, 2023

    @JohnReppy
    Contributor

    Thanks for testing the patch. I will modify the code with the extra #include. I looked at more recent versions of LLVM and they have that extra include in the Signals.h header.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingfixed-in-2024.1Issues that have been closed for the 2024.1 releaseinstallationproblem with installationllvm-codegenissues related to the LLVM-based code generator

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions