Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gollvm: missing headers, Clang's issues and broken libffi on Fedora 33 (64bit RISC-V) #42804

Closed
advancedwebdeveloper opened this issue Nov 24, 2020 · 10 comments
Milestone

Comments

@advancedwebdeveloper
Copy link

@advancedwebdeveloper advancedwebdeveloper commented Nov 24, 2020

Hi.
Here is the summary:

$ cmake -DCMAME_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLLVM_USE_LINKER=ld -DGOLLVM_DEFAULT_LINKER=ld -G Ninja ../llv
m-project/llvm
-- The C compiler identification is GNU 10.2.1
-- The CXX compiler identification is Clang 10.0.0
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/cc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- No build type selected, default to Debug
-- Performing Test LLVM_LIBSTDCXX_MIN
-- Performing Test LLVM_LIBSTDCXX_MIN - Success
-- Performing Test LLVM_LIBSTDCXX_SOFT_ERROR
-- Performing Test LLVM_LIBSTDCXX_SOFT_ERROR - Success
-- Looking for dlfcn.h
-- Looking for dlfcn.h - found
-- Looking for errno.h
-- Looking for errno.h - found
-- Looking for fcntl.h
-- Looking for fcntl.h - found
-- Looking for link.h
-- Looking for link.h - found
-- Looking for malloc/malloc.h
-- Looking for malloc/malloc.h - not found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for signal.h
-- Looking for signal.h - found
-- Looking for sys/ioctl.h
-- Looking for sys/ioctl.h - found
-- Looking for sys/mman.h
-- Looking for sys/mman.h - found
-- Looking for sys/param.h
-- Looking for sys/param.h - found
-- Looking for sys/resource.h
-- Looking for sys/resource.h - found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for sys/time.h
-- Looking for sys/time.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for sysexits.h
-- Looking for sysexits.h - found
-- Looking for termios.h
-- Looking for termios.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for valgrind/valgrind.h
-- Looking for valgrind/valgrind.h - not found
-- Looking for fenv.h
-- Looking for fenv.h - found
-- Looking for FE_ALL_EXCEPT
-- Looking for FE_ALL_EXCEPT - found
-- Looking for FE_INEXACT
-- Looking for FE_INEXACT - found
-- Looking for mach/mach.h
-- Looking for mach/mach.h - not found
-- Looking for histedit.h
-- Looking for histedit.h - found
-- Looking for CrashReporterClient.h
-- Looking for CrashReporterClient.h - not found
-- Looking for linux/magic.h
-- Looking for linux/magic.h - found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Looking for pthread_getspecific in pthread
-- Looking for pthread_getspecific in pthread - found
-- Looking for pthread_rwlock_init in pthread
-- Looking for pthread_rwlock_init in pthread - found
-- Looking for pthread_mutex_lock in pthread
-- Looking for pthread_mutex_lock in pthread - found
-- Looking for dlopen in dl
-- Looking for dlopen in dl - found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Looking for pfm_initialize in pfm
-- Looking for pfm_initialize in pfm - not found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.11")
-- Looking for compress2
-- Looking for compress2 - found
-- Could NOT find LibXml2 (missing: LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
-- Looking for el_init in edit
-- Looking for el_init in edit - found
-- Looking for xar_open in xar
-- Looking for xar_open in xar - not found
-- Looking for arc4random
-- Looking for arc4random - not found
-- Looking for backtrace
-- Looking for backtrace - found
-- backtrace facility detected in default set of libraries
-- Found Backtrace: /usr/include
-- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW
-- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Failed
-- Looking for __register_frame
-- Looking for __register_frame - found
-- Looking for __deregister_frame
-- Looking for __deregister_frame - found
-- Looking for _Unwind_Backtrace
-- Looking for _Unwind_Backtrace - found
-- Looking for getpagesize
-- Looking for getpagesize - found
-- Looking for sysconf
-- Looking for sysconf - found
-- Looking for getrusage
-- Looking for getrusage - found
-- Looking for setrlimit
-- Looking for setrlimit - found
-- Looking for isatty
-- Looking for isatty - found
-- Looking for futimens
-- Looking for futimens - found
-- Looking for futimes
-- Looking for futimes - found
-- Looking for posix_fallocate
-- Looking for posix_fallocate - found
-- Looking for sigaltstack
-- Looking for sigaltstack - found
-- Looking for lseek64
-- Looking for lseek64 - found
-- Looking for mallctl
-- Looking for mallctl - not found
-- Looking for mallinfo
-- Looking for mallinfo - found
-- Looking for malloc_zone_statistics
-- Looking for malloc_zone_statistics - not found
-- Looking for getrlimit
-- Looking for getrlimit - found
-- Looking for posix_spawn
-- Looking for posix_spawn - found
-- Looking for pread
-- Looking for pread - found
-- Looking for sbrk
-- Looking for sbrk - found
-- Looking for strerror
-- Looking for strerror - found
-- Looking for strerror_r
-- Looking for strerror_r - found
-- Looking for strerror_s
-- Looking for strerror_s - not found
-- Looking for setenv
-- Looking for setenv - found
-- Looking for dlopen
-- Looking for dlopen - found
-- Looking for dladdr
-- Looking for dladdr - not found
-- Performing Test HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC
-- Performing Test HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC - Failed
-- Performing Test HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
-- Performing Test HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC - Success
-- Looking for GLIBC
-- Looking for GLIBC - found
-- Looking for pthread_getname_np
-- Looking for pthread_getname_np - found
-- Looking for pthread_setname_np
-- Looking for pthread_setname_np - found
-- Performing Test HAVE_STD_IS_TRIVIALLY_COPYABLE
-- Performing Test HAVE_STD_IS_TRIVIALLY_COPYABLE - Success
-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB
-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB - Success
-- Performing Test HAVE_CXX_ATOMICS64_WITHOUT_LIB
-- Performing Test HAVE_CXX_ATOMICS64_WITHOUT_LIB - Success
-- Performing Test LLVM_HAS_ATOMICS
-- Performing Test LLVM_HAS_ATOMICS - Success
-- Performing Test SUPPORTS_VARIADIC_MACROS_FLAG
-- Performing Test SUPPORTS_VARIADIC_MACROS_FLAG - Success
-- Performing Test SUPPORTS_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG
-- Performing Test SUPPORTS_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG - Success
-- Native target architecture is RISCV
-- Threads enabled.
-- Doxygen disabled.
-- Go bindings disabled.
-- Ninja version: 1.10.0.git.kitware.jobserver-1
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
-- OCaml bindings disabled.
-- Could NOT find Python module pygments
-- Could NOT find Python module pygments.lexers.c_cpp
-- Could NOT find Python module yaml
-- LLVM host triple: riscv64-unknown-linux-gnu
-- LLVM default target triple: riscv64-unknown-linux-gnu
-- Performing Test CXX_SUPPORTS_CUSTOM_LINKER
-- Performing Test CXX_SUPPORTS_CUSTOM_LINKER - Success
-- Performing Test C_SUPPORTS_FPIC
-- Performing Test C_SUPPORTS_FPIC - Failed
-- Performing Test CXX_SUPPORTS_FPIC
-- Performing Test CXX_SUPPORTS_FPIC - Success
CMake Warning at cmake/modules/HandleLLVMOptions.cmake:261 (message):
-fPIC is not supported.
Call Stack (most recent call first):
cmake/modules/HandleLLVMOptions.cmake:297 (add_flag_or_print_warning)
CMakeLists.txt:700 (include)

-- Performing Test SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG
-- Performing Test SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG - Success
-- Performing Test C_SUPPORTS_WERROR_DATE_TIME
-- Performing Test C_SUPPORTS_WERROR_DATE_TIME - Failed
-- Performing Test CXX_SUPPORTS_WERROR_DATE_TIME
-- Performing Test CXX_SUPPORTS_WERROR_DATE_TIME - Success
-- Performing Test CXX_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW
-- Performing Test CXX_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Success
-- Performing Test CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG
-- Performing Test CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG - Success
-- Performing Test C_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG
-- Performing Test C_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG - Failed
-- Performing Test CXX_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG
-- Performing Test CXX_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG - Success
-- Performing Test C_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG
-- Performing Test C_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG - Failed
-- Performing Test CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG
-- Performing Test CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG - Success
-- Performing Test CXX_SUPPORTS_CLASS_MEMACCESS_FLAG
-- Performing Test CXX_SUPPORTS_CLASS_MEMACCESS_FLAG - Failed
-- Performing Test CXX_SUPPORTS_NOEXCEPT_TYPE_FLAG
-- Performing Test CXX_SUPPORTS_NOEXCEPT_TYPE_FLAG - Success
-- Performing Test CXX_WONT_WARN_ON_FINAL_NONVIRTUALDTOR
-- Performing Test CXX_WONT_WARN_ON_FINAL_NONVIRTUALDTOR - Success
-- Performing Test C_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG
-- Performing Test C_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG - Failed
-- Performing Test CXX_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG
-- Performing Test CXX_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG - Success
-- Performing Test CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG
-- Performing Test CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG - Failed
-- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP
-- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP - Failed
-- Performing Test C_SUPPORTS_STRING_CONVERSION_FLAG
-- Performing Test C_SUPPORTS_STRING_CONVERSION_FLAG - Failed
-- Performing Test CXX_SUPPORTS_STRING_CONVERSION_FLAG
-- Performing Test CXX_SUPPORTS_STRING_CONVERSION_FLAG - Success
-- Performing Test LINKER_SUPPORTS_COLOR_DIAGNOSTICS
-- Performing Test LINKER_SUPPORTS_COLOR_DIAGNOSTICS - Failed
-- Looking for os_signpost_interval_begin
-- Looking for os_signpost_interval_begin - not found
-- Found Python3: /usr/bin/python3.9 (found version "3.9.0") found components: Interpreter
-- Linker detection: unknown
-- Found Git: /usr/bin/git (found version "2.27.0")
-- Targeting AArch64
-- Targeting AMDGPU
-- Targeting ARM
-- Targeting AVR
-- Targeting BPF
-- Targeting Hexagon
-- Targeting Lanai
-- Targeting Mips
-- Targeting MSP430
-- Targeting NVPTX
-- Targeting PowerPC
-- Targeting RISCV
-- Targeting Sparc
-- Targeting SystemZ
-- Targeting WebAssembly
-- Targeting X86
-- Targeting XCore
-- default linker set to "ld"
-- Performing Test C_SUPPORTS_CF_PROTECTION_BRANCH
-- Performing Test C_SUPPORTS_CF_PROTECTION_BRANCH - Failed
-- Performing Test SPLIT_STACK_FUNCTIONAL
-- Performing Test SPLIT_STACK_FUNCTIONAL - Failed
CMake Error at tools/gollvm/cmake/modules/AddGollvm.cmake:68 (message):
C compiler does not support -fsplit-stack
Call Stack (most recent call first):
tools/gollvm/CMakeLists.txt:22 (include)

-- starting libgo configuration.
-- Performing Test HAVE_ATOMIC_FUNCTIONS
-- Performing Test HAVE_ATOMIC_FUNCTIONS - Failed
-- Looking for clock_gettime
-- Looking for clock_gettime - not found
-- Looking for strnlen
-- Looking for strnlen - not found
-- Looking for dl_iterate_phdr
-- Looking for dl_iterate_phdr - not found
-- Looking for fcntl
-- Looking for fcntl - not found
-- Looking for getexecname
-- Looking for getexecname - not found
-- Looking for lstat
-- Looking for lstat - not found
-- Looking for readlink
-- Looking for readlink - not found
-- Looking for mmap
-- Looking for mmap - not found
-- Looking for accept4
-- Looking for accept4 - not found
-- Looking for dup3
-- Looking for dup3 - not found
-- Looking for epoll_create1
-- Looking for epoll_create1 - not found
-- Looking for faccessat
-- Looking for faccessat - not found
-- Looking for fallocate
-- Looking for fallocate - not found
-- Looking for fchmodat
-- Looking for fchmodat - not found
-- Looking for fchownat
-- Looking for fchownat - not found
-- Looking for futimesat
-- Looking for futimesat - not found
-- Looking for inotify_add_watch
-- Looking for inotify_add_watch - not found
-- Looking for inotify_init
-- Looking for inotify_init - not found
-- Looking for inotify_init1
-- Looking for inotify_init1 - not found
-- Looking for inotify_rm_watch
-- Looking for inotify_rm_watch - not found
-- Looking for listxattr
-- Looking for listxattr - not found
-- Looking for mincore
-- Looking for mincore - not found
-- Looking for mkdirat
-- Looking for mkdirat - not found
-- Looking for openat
-- Looking for openat - not found
-- Looking for removexattr
-- Looking for removexattr - not found
-- Looking for renameat
-- Looking for renameat - not found
-- Looking for setxattr
-- Looking for setxattr - not found
-- Looking for splice
-- Looking for splice - not found
-- Looking for sync_file_range
-- Looking for sync_file_range - not found
-- Looking for syscall
-- Looking for syscall - not found
-- Looking for tee
-- Looking for tee - not found
-- Looking for unlinkat
-- Looking for unlinkat - not found
-- Looking for unsetenv
-- Looking for unsetenv - not found
-- Looking for unshare
-- Looking for unshare - not found
-- Looking for utimensat
-- Looking for utimensat - not found
-- Looking for wait4
-- Looking for wait4 - not found
-- Looking for open64
-- Looking for open64 - not found
-- Looking for mknodat
-- Looking for mknodat - not found
-- Looking for pipe2
-- Looking for pipe2 - not found
-- Looking for memmem
-- Looking for memmem - not found
-- Looking for inttypes.h
-- Looking for inttypes.h - not found
-- Looking for linux/ether.h
-- Looking for linux/ether.h - not found
-- Looking for linux/filter.h
-- Looking for linux/filter.h - not found
-- Looking for linux/fs.h
-- Looking for linux/fs.h - not found
-- Looking for linux/if_addr.h
-- Looking for linux/if_addr.h - not found
-- Looking for linux/if_ether.h
-- Looking for linux/if_ether.h - not found
-- Looking for linux/if_tun.h
-- Looking for linux/if_tun.h - not found
-- Looking for linux/netlink.h
-- Looking for linux/netlink.h - not found
-- Looking for linux/ptrace.h
-- Looking for linux/ptrace.h - not found
-- Looking for linux/reboot.h
-- Looking for linux/reboot.h - not found
-- Looking for linux/rtnetlink.h
-- Looking for linux/rtnetlink.h - not found
-- Looking for memory.h
-- Looking for memory.h - not found
-- Looking for net/if.h
-- Looking for net/if.h - not found
-- Looking for net/if_arp.h
-- Looking for net/if_arp.h - not found
-- Looking for net/route.h
-- Looking for net/route.h - not found
-- Looking for netinet/icmp6.h
-- Looking for netinet/icmp6.h - not found
-- Looking for netinet/if_ether.h
-- Looking for netinet/if_ether.h - not found
-- Looking for netinet/in_systm.h
-- Looking for netinet/in_systm.h - not found
-- Looking for netinet/ip.h
-- Looking for netinet/ip.h - not found
-- Looking for netinet/ip_mroute.h
-- Looking for netinet/ip_mroute.h - not found
-- Looking for netpacket/packet.h
-- Looking for netpacket/packet.h - not found
-- Looking for port.h
-- Looking for port.h - not found
-- Looking for sched.h
-- Looking for sched.h - not found
-- Looking for semaphore.h
-- Looking for semaphore.h - not found
-- Looking for stdint.h
-- Looking for stdint.h - not found
-- Looking for stdlib.h
-- Looking for stdlib.h - not found
-- Looking for strings.h
-- Looking for strings.h - not found
-- Looking for sys/epoll.h
-- Looking for sys/epoll.h - not found
-- Looking for sys/file.h
-- Looking for sys/file.h - not found
-- Looking for sys/inotify.h
-- Looking for sys/inotify.h - not found
-- Looking for sys/mount.h
-- Looking for sys/mount.h - not found
-- Looking for sys/prctl.h
-- Looking for sys/prctl.h - not found
-- Looking for sys/ptrace.h
-- Looking for sys/ptrace.h - not found
-- Looking for sys/select.h
-- Looking for sys/select.h - not found
-- Looking for sys/statfs.h
-- Looking for sys/statfs.h - not found
-- Looking for sys/syscall.h
-- Looking for sys/syscall.h - not found
-- Looking for sys/sysinfo.h
-- Looking for sys/sysinfo.h - not found
-- Looking for sys/timex.h
-- Looking for sys/timex.h - not found
-- Looking for sys/user.h
-- Looking for sys/user.h - not found
-- Looking for sys/utsname.h
-- Looking for sys/utsname.h - not found
-- Looking for sys/vfs.h
-- Looking for sys/vfs.h - not found
-- Looking for syscall.h
-- Looking for syscall.h - not found
-- Looking for utime.h
-- Looking for utime.h - not found
-- Looking for compress in z
-- Looking for compress in z - not found
-- Looking for stddef.h
-- Looking for stddef.h - not found
-- Check size of double
-- Check size of double - failed
-- Check size of long double
-- Check size of long double - failed
-- Check size of long double
-- Check size of long double - failed
-- Check size of void*
-- Check size of void* - failed
-- Looking for alloca.h
-- Looking for alloca.h - not found
-- Looking for alloca
-- Looking for alloca - not found
-- Looking for memcpy
-- Looking for memcpy - not found
-- Performing Test HAVE_SYNC_BOOL_COMPARE_AND_SWAP_4
-- Performing Test HAVE_SYNC_BOOL_COMPARE_AND_SWAP_4 - Failed
-- Performing Test HAVE_SYNC_BOOL_COMPARE_AND_SWAP_8
-- Performing Test HAVE_SYNC_BOOL_COMPARE_AND_SWAP_8 - Failed
-- Performing Test HAVE_AS_X86_AES
-- Performing Test HAVE_AS_X86_AES - Failed
CMake Error at tools/gollvm/cmake/modules/LibbacktraceUtils.cmake:15 (message):
Libbacktrace config setup not implemented for riscv64
Call Stack (most recent call first):
tools/gollvm/libgo/CMakeLists.txt:45 (setup_libbacktrace)

CMake Error at tools/gollvm/cmake/modules/LibbacktraceUtils.cmake:19 (message):
Support for mmap() is required -- setup failed.
Call Stack (most recent call first):
tools/gollvm/libgo/CMakeLists.txt:45 (setup_libbacktrace)

CMake Error at tools/gollvm/cmake/modules/LibffiUtils.cmake:13 (message):
Arch riscv64 not yet supported
Call Stack (most recent call first):
tools/gollvm/libgo/CMakeLists.txt:49 (setup_libffi)

CMake Error at tools/gollvm/cmake/modules/LibffiUtils.cmake:27 (message):
Support for mmap() is required -- setup failed.
Call Stack (most recent call first):
tools/gollvm/libgo/CMakeLists.txt:49 (setup_libffi)

CMake Error at tools/gollvm/cmake/modules/LibffiUtils.cmake:91 (file):
file COPY cannot find
"/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libffi/src//ffitarget.h":
No such file or directory.
Call Stack (most recent call first):
tools/gollvm/libgo/CMakeLists.txt:49 (setup_libffi)

@advancedwebdeveloper
Copy link
Author

@advancedwebdeveloper advancedwebdeveloper commented Nov 24, 2020

I have a typo:

$ cmake -DCMAME_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLLVM_USE_LINKER=ld -DGOLLVM_DEFAULT_LINKER=ld -G Ninja ../llv
m-project/llvm

Re-checking after correction.

I see a recurrent errors, within nearly each CMake's check:

cc: error: unrecognized command-line option ‘-fuse-ld=ld’; did you mean ‘-fuse-ld=lld’?
ninja: build stopped: subcommand failed.
. It is expect to work only with Clang (as far as I remember).
It can't explain some other errors (especially for libffi).

@advancedwebdeveloper
Copy link
Author

@advancedwebdeveloper advancedwebdeveloper commented Nov 24, 2020

I have fixed CMake's flags - and now it looks pretty weird:

$cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLLVM_USE_LINKER=lld -DGOLLVM_DEFAULT_LINKER=lld -G Ninja ../llvm-project/llvm
-- The C compiler identification is Clang 10.0.0
-- The CXX compiler identification is Clang 10.0.0
-- The ASM compiler identification is Clang
-- Found assembler: /usr/bin/clang
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- No build type selected, default to Debug
-- Performing Test LLVM_LIBSTDCXX_MIN
-- Performing Test LLVM_LIBSTDCXX_MIN - Success
-- Performing Test LLVM_LIBSTDCXX_SOFT_ERROR
-- Performing Test LLVM_LIBSTDCXX_SOFT_ERROR - Success
-- Looking for dlfcn.h
-- Looking for dlfcn.h - found
-- Looking for errno.h
-- Looking for errno.h - found
-- Looking for fcntl.h
-- Looking for fcntl.h - found
-- Looking for link.h
-- Looking for link.h - found
-- Looking for malloc/malloc.h
-- Looking for malloc/malloc.h - not found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for signal.h
-- Looking for signal.h - found
-- Looking for sys/ioctl.h
-- Looking for sys/ioctl.h - found
-- Looking for sys/mman.h
-- Looking for sys/mman.h - found
-- Looking for sys/param.h
-- Looking for sys/param.h - found
-- Looking for sys/resource.h
-- Looking for sys/resource.h - found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for sys/time.h
-- Looking for sys/time.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for sysexits.h
-- Looking for sysexits.h - found
-- Looking for termios.h
-- Looking for termios.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for valgrind/valgrind.h
-- Looking for valgrind/valgrind.h - not found
-- Looking for fenv.h
-- Looking for fenv.h - found
-- Looking for FE_ALL_EXCEPT
-- Looking for FE_ALL_EXCEPT - found
-- Looking for FE_INEXACT
-- Looking for FE_INEXACT - found
-- Looking for mach/mach.h
-- Looking for mach/mach.h - not found
-- Looking for histedit.h
-- Looking for histedit.h - found
-- Looking for CrashReporterClient.h
-- Looking for CrashReporterClient.h - not found
-- Looking for linux/magic.h
-- Looking for linux/magic.h - found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Looking for pthread_getspecific in pthread
-- Looking for pthread_getspecific in pthread - found
-- Looking for pthread_rwlock_init in pthread
-- Looking for pthread_rwlock_init in pthread - found
-- Looking for pthread_mutex_lock in pthread
-- Looking for pthread_mutex_lock in pthread - found
-- Looking for dlopen in dl
-- Looking for dlopen in dl - found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Looking for pfm_initialize in pfm
-- Looking for pfm_initialize in pfm - not found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.11")
-- Looking for compress2
-- Looking for compress2 - found
-- Could NOT find LibXml2 (missing: LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
-- Looking for el_init in edit
-- Looking for el_init in edit - found
-- Looking for xar_open in xar
-- Looking for xar_open in xar - not found
-- Looking for arc4random
-- Looking for arc4random - not found
-- Looking for backtrace
-- Looking for backtrace - found
-- backtrace facility detected in default set of libraries
-- Found Backtrace: /usr/include
-- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW
-- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Success
-- Looking for __register_frame
-- Looking for __register_frame - found
-- Looking for __deregister_frame
-- Looking for __deregister_frame - found
-- Looking for _Unwind_Backtrace
-- Looking for _Unwind_Backtrace - found
-- Looking for getpagesize
-- Looking for getpagesize - found
-- Looking for sysconf
-- Looking for sysconf - found
-- Looking for getrusage
-- Looking for getrusage - found
-- Looking for setrlimit
-- Looking for setrlimit - found
-- Looking for isatty
-- Looking for isatty - found
-- Looking for futimens
-- Looking for futimens - found
-- Looking for futimes
-- Looking for futimes - found
-- Looking for posix_fallocate
-- Looking for posix_fallocate - found
-- Looking for sigaltstack
-- Looking for sigaltstack - found
-- Looking for lseek64
-- Looking for lseek64 - found
-- Looking for mallctl
-- Looking for mallctl - not found
-- Looking for mallinfo
-- Looking for mallinfo - found
-- Looking for malloc_zone_statistics
-- Looking for malloc_zone_statistics - not found
-- Looking for getrlimit
-- Looking for getrlimit - found
-- Looking for posix_spawn
-- Looking for posix_spawn - found
-- Looking for pread
-- Looking for pread - found
-- Looking for sbrk
-- Looking for sbrk - found
-- Looking for strerror
-- Looking for strerror - found
-- Looking for strerror_r
-- Looking for strerror_r - found
-- Looking for strerror_s
-- Looking for strerror_s - not found
-- Looking for setenv
-- Looking for setenv - found
-- Looking for dlopen
-- Looking for dlopen - found
-- Looking for dladdr
-- Looking for dladdr - not found
-- Performing Test HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC
-- Performing Test HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC - Failed
-- Performing Test HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
-- Performing Test HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC - Success
-- Looking for GLIBC
-- Looking for GLIBC - found
-- Looking for pthread_getname_np
-- Looking for pthread_getname_np - found
-- Looking for pthread_setname_np
-- Looking for pthread_setname_np - found
-- Performing Test HAVE_STD_IS_TRIVIALLY_COPYABLE
-- Performing Test HAVE_STD_IS_TRIVIALLY_COPYABLE - Success
-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB
-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB - Success
-- Performing Test HAVE_CXX_ATOMICS64_WITHOUT_LIB
-- Performing Test HAVE_CXX_ATOMICS64_WITHOUT_LIB - Success
-- Performing Test LLVM_HAS_ATOMICS
-- Performing Test LLVM_HAS_ATOMICS - Success
-- Performing Test SUPPORTS_VARIADIC_MACROS_FLAG
-- Performing Test SUPPORTS_VARIADIC_MACROS_FLAG - Success
-- Performing Test SUPPORTS_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG
-- Performing Test SUPPORTS_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG - Success
-- Native target architecture is RISCV
-- Threads enabled.
-- Doxygen disabled.
-- Go bindings disabled.
-- Ninja version: 1.10.0.git.kitware.jobserver-1
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
-- OCaml bindings disabled.
-- Could NOT find Python module pygments
-- Could NOT find Python module pygments.lexers.c_cpp
-- Could NOT find Python module yaml
-- LLVM host triple: riscv64-unknown-linux-gnu
-- LLVM default target triple: riscv64-unknown-linux-gnu
-- Performing Test CXX_SUPPORTS_CUSTOM_LINKER
-- Performing Test CXX_SUPPORTS_CUSTOM_LINKER - Failed
CMake Error at cmake/modules/HandleLLVMOptions.cmake:282 (message):
Host compiler does not support '-fuse-ld=lld'
Call Stack (most recent call first):
CMakeLists.txt:700 (include)

@advancedwebdeveloper
Copy link
Author

@advancedwebdeveloper advancedwebdeveloper commented Nov 24, 2020

I didn't get it: why most of the checks are performed by "cc", instead of Clang?

Source file was:
int main(void) { return 0; }
Performing C SOURCE FILE Test C_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG failed with the following output:
Change Dir: /home/oceanfish81/workarea/build_riscv_release/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/local/bin/ninja cmTC_2981c && [1/2] Building C object CMakeFiles/cmTC_2981c.dir/src.c.o
[2/2] Linking C executable cmTC_2981c
FAILED: cmTC_2981c
: && /usr/bin/cc -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers -pedantic -Wno-long-long -DC_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG -fuse-ld=ld CMakeFiles/cmTC_2981c.dir/src.c.o -o cmTC_2981c -lm && :
cc: error: unrecognized command-line option '-fuse-ld=ld'; did you mean '-fuse-ld=lld'?
ninja: build stopped: subcommand failed.

And since when Clang 10 don't recognize "-fuse-ld=lld" ?

Run Build Command(s):/usr/local/bin/ninja cmTC_013a3 && [1/2] Building CXX object CMakeFiles/cmTC_013a3.dir/src.cxx.o
clang-10: warning: argument unused during compilation: '-fuse-ld=lld' [-Wunused-command-line-argument]
[2/2] Linking CXX executable cmTC_013a3
FAILED: cmTC_013a3
: && /usr/bin/clang++ -DCXX_SUPPORTS_CUSTOM_LINKER -Werror=unguarded-availability-new -fuse-ld=lld CMakeFiles/cmTC_013a3.dir/src.cxx.o -o cmTC_013a3 -lm && :
ld.lld: error: /usr/bin/../lib/gcc/riscv64-redhat-linux/10/../../../../lib64/crt1.o:(.text+0x0): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: src.cxx:(.text+0x0): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: /builddir/build/BUILD/lld-10.0.0.src/ELF/Relocations.cpp:987: uint64_t lld:🧝:{anonymous}::OffsetGetter::get(uint64_t): Assertion `pieces[i].inputOff <= off && "Relocation not in any piece"' failed.
Stack dump:
0. Program arguments: /usr/bin/ld.lld --hash-style=gnu --build-id --eh-frame-hdr -m elf64lriscv -dynamic-linker /lib/ld-linux-riscv64-lp64d.so.1 -o cmTC_013a3 /usr/bin/../lib/gcc/riscv64-redhat-linux/10/../../../../lib64/crt1.o /usr/bin/../lib/gcc/riscv64-redhat-linux/10/crti.o /usr/bin/../lib/gcc/riscv64-redhat-linux/10/crtbegin.o -L/usr/bin/../lib/gcc/riscv64-redhat-linux/10 -L/usr/bin/../lib/gcc/riscv64-redhat-linux/10/../../../../lib64 -L/usr/bin/../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/lib64/lp64d -L/usr/lib64/lp64d -L/usr/bin/../lib/gcc/riscv64-redhat-linux/10/../../.. -L/usr/bin/../lib -L/lib -L/usr/lib CMakeFiles/cmTC_013a3.dir/src.cxx.o -lm -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/bin/../lib/gcc/riscv64-redhat-linux/10/crtend.o /usr/bin/../lib/gcc/riscv64-redhat-linux/10/crtn.o
#0 0x0000003fe68eeeda llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/lib64/lp64d/libLLVM-10.so+0x966eda)
#1 0x0000003fe68ed9fc llvm::sys::RunSignalHandlers() (/lib64/lp64d/libLLVM-10.so+0x9659fc)
#2 0x0000003fe68edba0 (/lib64/lp64d/libLLVM-10.so+0x965ba0)
#3 0x0000003fea728800 (linux-vdso.so.1+0x800)
#4 0x0000003fe5ce21c4 raise (/lib64/lp64d/libc.so.6+0x331c4)
#5 0x0000003fe5cd272c abort (/lib64/lp64d/libc.so.6+0x2372c)
#6 0x0000003fe5cdcc82 __assert_fail_base (/lib64/lp64d/libc.so.6+0x2dc82)
#7 0x0000003fe5cdccd6 __assert_perror_fail (/lib64/lp64d/libc.so.6+0x2dcd6)
#8 0x0000003fea5c3092 (/lib64/lp64d/liblldELF.so.10+0x12a092)
#9 0x0000003fea5d809a void lld:🧝:scanRelocations<llvm::object::ELFType<(llvm::support::endianness)1, true> >(lld:🧝:InputSectionBase&) (/lib64/lp64d/liblldELF.so.10+0x13f09a)
#10 0x0000003fea64bb7e (/lib64/lp64d/liblldELF.so.10+0x1b2b7e)
#11 0x0000003fea66f51e (/lib64/lp64d/liblldELF.so.10+0x1d651e)
#12 0x0000003fea670504 void lld:🧝:writeResult<llvm::object::ELFType<(llvm::support::endianness)1, true> >() (/lib64/lp64d/liblldELF.so.10+0x1d7504)
#13 0x0000003fea54b37e void lld:🧝:LinkerDriver::link<llvm::object::ELFType<(llvm::support::endianness)1, true> >(llvm::opt::InputArgList&) (/lib64/lp64d/liblldELF.so.10+0xb237e)
#14 0x0000003fea50cfc8 lld:🧝:LinkerDriver::main(llvm::ArrayRef<char const*>) (/lib64/lp64d/liblldELF.so.10+0x73fc8)
#15 0x0000003fea54d3b6 lld:🧝:link(llvm::ArrayRef<char const*>, bool, llvm::raw_ostream&, llvm::raw_ostream&) (/lib64/lp64d/liblldELF.so.10+0xb43b6)
#16 0x0000002ac5be8a86 main (/usr/bin/ld.lld+0x1a86)
#17 0x0000003fe5cd2926 __libc_start_main (/lib64/lp64d/libc.so.6+0x23926)
#18 0x0000002ac5be8dc4 (/usr/bin/ld.lld+0x1dc4)

@advancedwebdeveloper
Copy link
Author

@advancedwebdeveloper advancedwebdeveloper commented Nov 24, 2020

As for the bfd linker - I got this:

$cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLLVM_USE_LINKER=bfd -DGOLLVM_DEFAULT_LINKER=bfd -G Ninja ../llvm-project/llvm
-- Could NOT find LibXml2 (missing: LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)

-- Native target architecture is RISCV
-- Threads enabled.
-- Doxygen disabled.
-- Go bindings disabled.
-- Ninja version: 1.10.0.git.kitware.jobserver-1
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
-- OCaml bindings disabled.
-- LLVM host triple: riscv64-unknown-linux-gnu
-- LLVM default target triple: riscv64-unknown-linux-gnu
CMake Error at cmake/modules/HandleLLVMOptions.cmake:282 (message):
Host compiler does not support '-fuse-ld=bfd'
Call Stack (most recent call first):
CMakeLists.txt:700 (include)

$cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLLVM_USE_LINKER=ld.bfd -DGOLLVM_DEFAULT_LINKER=ld.bfd -G Ninja ../llvm-project/llvm
-- Could NOT find LibXml2 (missing: LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
-- Native target architecture is RISCV
-- Threads enabled.
-- Doxygen disabled.
-- Go bindings disabled.
-- Ninja version: 1.10.0.git.kitware.jobserver-1
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
-- OCaml bindings disabled.
-- LLVM host triple: riscv64-unknown-linux-gnu
-- LLVM default target triple: riscv64-unknown-linux-gnu
CMake Error at cmake/modules/HandleLLVMOptions.cmake:282 (message):
Host compiler does not support '-fuse-ld=ld.bfd'
Call Stack (most recent call first):
CMakeLists.txt:700 (include)

@advancedwebdeveloper
Copy link
Author

@advancedwebdeveloper advancedwebdeveloper commented Nov 24, 2020

I have

$ clang --version
clang version 10.0.0 (Fedora 10.0.0-1.0.riscv64.fc33)
Target: riscv64-unknown-linux-gnu
Thread model: posix

and

$ ld.bfd --version
GNU ld version 2.35-10.fc33

@advancedwebdeveloper
Copy link
Author

@advancedwebdeveloper advancedwebdeveloper commented Nov 24, 2020

clang-10: warning: argument unused during compilation: '-fuse-ld=ld.bfd' [-Wunused-command-line-argument]
[2/2] Linking CXX executable cmTC_67f08
FAILED: cmTC_67f08
: && /usr/bin/clang++ -DCXX_SUPPORTS_CUSTOM_LINKER -Werror=unguarded-availability-new -fuse-ld=ld.bfd CMakeFiles/cmTC_67f08.dir/src.cxx.o -o cmTC_67f08 -lm && :
clang-10: error: invalid linker name in argument '-fuse-ld=ld.bfd'
ninja: build stopped: subcommand failed.

@advancedwebdeveloper
Copy link
Author

@advancedwebdeveloper advancedwebdeveloper commented Nov 24, 2020

I have some progress:

$cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS=' -mno-relax ' -DLLVM_USE_LINKER=ld -DGOLLVM_DEFAULT_LINKER=ld -G Ninja ../llvm-project/llvm
-- The C compiler identification is Clang 10.0.0
-- The CXX compiler identification is Clang 10.0.0
-- The ASM compiler identification is Clang
-- Found assembler: /usr/bin/clang
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- No build type selected, default to Debug
-- Performing Test LLVM_LIBSTDCXX_MIN
-- Performing Test LLVM_LIBSTDCXX_MIN - Success
-- Performing Test LLVM_LIBSTDCXX_SOFT_ERROR
-- Performing Test LLVM_LIBSTDCXX_SOFT_ERROR - Success
-- Looking for dlfcn.h
-- Looking for dlfcn.h - found
-- Looking for errno.h
-- Looking for errno.h - found
-- Looking for fcntl.h
-- Looking for fcntl.h - found
-- Looking for link.h
-- Looking for link.h - found
-- Looking for malloc/malloc.h
-- Looking for malloc/malloc.h - not found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for signal.h
-- Looking for signal.h - found
-- Looking for sys/ioctl.h
-- Looking for sys/ioctl.h - found
-- Looking for sys/mman.h
-- Looking for sys/mman.h - found
-- Looking for sys/param.h
-- Looking for sys/param.h - found
-- Looking for sys/resource.h
-- Looking for sys/resource.h - found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for sys/time.h
-- Looking for sys/time.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for sysexits.h
-- Looking for sysexits.h - found
-- Looking for termios.h
-- Looking for termios.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for valgrind/valgrind.h
-- Looking for valgrind/valgrind.h - not found
-- Looking for fenv.h
-- Looking for fenv.h - found
-- Looking for FE_ALL_EXCEPT
-- Looking for FE_ALL_EXCEPT - found
-- Looking for FE_INEXACT
-- Looking for FE_INEXACT - found
-- Looking for mach/mach.h
-- Looking for mach/mach.h - not found
-- Looking for histedit.h
-- Looking for histedit.h - found
-- Looking for CrashReporterClient.h
-- Looking for CrashReporterClient.h - not found
-- Looking for linux/magic.h
-- Looking for linux/magic.h - found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Looking for pthread_getspecific in pthread
-- Looking for pthread_getspecific in pthread - found
-- Looking for pthread_rwlock_init in pthread
-- Looking for pthread_rwlock_init in pthread - found
-- Looking for pthread_mutex_lock in pthread
-- Looking for pthread_mutex_lock in pthread - found
-- Looking for dlopen in dl
-- Looking for dlopen in dl - found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Looking for pfm_initialize in pfm
-- Looking for pfm_initialize in pfm - not found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.11")
-- Looking for compress2
-- Looking for compress2 - found
-- Could NOT find LibXml2 (missing: LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
-- Looking for el_init in edit
-- Looking for el_init in edit - found
-- Looking for xar_open in xar
-- Looking for xar_open in xar - not found
-- Looking for arc4random
-- Looking for arc4random - not found
-- Looking for backtrace
-- Looking for backtrace - found
-- backtrace facility detected in default set of libraries
-- Found Backtrace: /usr/include
-- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW
-- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Success
-- Looking for __register_frame
-- Looking for __register_frame - found
-- Looking for __deregister_frame
-- Looking for __deregister_frame - found
-- Looking for _Unwind_Backtrace
-- Looking for _Unwind_Backtrace - found
-- Looking for getpagesize
-- Looking for getpagesize - found
-- Looking for sysconf
-- Looking for sysconf - found
-- Looking for getrusage
-- Looking for getrusage - found
-- Looking for setrlimit
-- Looking for setrlimit - found
-- Looking for isatty
-- Looking for isatty - found
-- Looking for futimens
-- Looking for futimens - found
-- Looking for futimes
-- Looking for futimes - found
-- Looking for posix_fallocate
-- Looking for posix_fallocate - found
-- Looking for sigaltstack
-- Looking for sigaltstack - found
-- Looking for lseek64
-- Looking for lseek64 - found
-- Looking for mallctl
-- Looking for mallctl - not found
-- Looking for mallinfo
-- Looking for mallinfo - found
-- Looking for malloc_zone_statistics
-- Looking for malloc_zone_statistics - not found
-- Looking for getrlimit
-- Looking for getrlimit - found
-- Looking for posix_spawn
-- Looking for posix_spawn - found
-- Looking for pread
-- Looking for pread - found
-- Looking for sbrk
-- Looking for sbrk - found
-- Looking for strerror
-- Looking for strerror - found
-- Looking for strerror_r
-- Looking for strerror_r - found
-- Looking for strerror_s
-- Looking for strerror_s - not found
-- Looking for setenv
-- Looking for setenv - found
-- Looking for dlopen
-- Looking for dlopen - found
-- Looking for dladdr
-- Looking for dladdr - not found
-- Performing Test HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC
-- Performing Test HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC - Failed
-- Performing Test HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
-- Performing Test HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC - Success
-- Looking for GLIBC
-- Looking for GLIBC - found
-- Looking for pthread_getname_np
-- Looking for pthread_getname_np - found
-- Looking for pthread_setname_np
-- Looking for pthread_setname_np - found
-- Performing Test HAVE_STD_IS_TRIVIALLY_COPYABLE
-- Performing Test HAVE_STD_IS_TRIVIALLY_COPYABLE - Success
-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB
-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB - Success
-- Performing Test HAVE_CXX_ATOMICS64_WITHOUT_LIB
-- Performing Test HAVE_CXX_ATOMICS64_WITHOUT_LIB - Success
-- Performing Test LLVM_HAS_ATOMICS
-- Performing Test LLVM_HAS_ATOMICS - Success
-- Performing Test SUPPORTS_VARIADIC_MACROS_FLAG
-- Performing Test SUPPORTS_VARIADIC_MACROS_FLAG - Success
-- Performing Test SUPPORTS_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG
-- Performing Test SUPPORTS_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG - Success
-- Native target architecture is RISCV
-- Threads enabled.
-- Doxygen disabled.
-- Go bindings disabled.
-- Ninja version: 1.10.0.git.kitware.jobserver-1
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
-- OCaml bindings disabled.
-- Could NOT find Python module pygments
-- Could NOT find Python module pygments.lexers.c_cpp
-- Could NOT find Python module yaml
-- LLVM host triple: riscv64-unknown-linux-gnu
-- LLVM default target triple: riscv64-unknown-linux-gnu
-- Performing Test CXX_SUPPORTS_CUSTOM_LINKER
-- Performing Test CXX_SUPPORTS_CUSTOM_LINKER - Success
-- Performing Test C_SUPPORTS_FPIC
-- Performing Test C_SUPPORTS_FPIC - Success
-- Performing Test CXX_SUPPORTS_FPIC
-- Performing Test CXX_SUPPORTS_FPIC - Success
-- Building with -fPIC
-- Performing Test SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG
-- Performing Test SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG - Success
-- Performing Test C_SUPPORTS_WERROR_DATE_TIME
-- Performing Test C_SUPPORTS_WERROR_DATE_TIME - Success
-- Performing Test CXX_SUPPORTS_WERROR_DATE_TIME
-- Performing Test CXX_SUPPORTS_WERROR_DATE_TIME - Success
-- Performing Test CXX_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW
-- Performing Test CXX_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Success
-- Performing Test CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG
-- Performing Test CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG - Success
-- Performing Test C_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG
-- Performing Test C_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG - Success
-- Performing Test CXX_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG
-- Performing Test CXX_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG - Success
-- Performing Test C_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG
-- Performing Test C_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG - Success
-- Performing Test CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG
-- Performing Test CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG - Success
-- Performing Test CXX_SUPPORTS_CLASS_MEMACCESS_FLAG
-- Performing Test CXX_SUPPORTS_CLASS_MEMACCESS_FLAG - Failed
-- Performing Test CXX_SUPPORTS_NOEXCEPT_TYPE_FLAG
-- Performing Test CXX_SUPPORTS_NOEXCEPT_TYPE_FLAG - Success
-- Performing Test CXX_WONT_WARN_ON_FINAL_NONVIRTUALDTOR
-- Performing Test CXX_WONT_WARN_ON_FINAL_NONVIRTUALDTOR - Success
-- Performing Test C_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG
-- Performing Test C_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG - Success
-- Performing Test CXX_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG
-- Performing Test CXX_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG - Success
-- Performing Test CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG
-- Performing Test CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG - Failed
-- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP
-- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP - Success
-- Performing Test C_SUPPORTS_STRING_CONVERSION_FLAG
-- Performing Test C_SUPPORTS_STRING_CONVERSION_FLAG - Success
-- Performing Test CXX_SUPPORTS_STRING_CONVERSION_FLAG
-- Performing Test CXX_SUPPORTS_STRING_CONVERSION_FLAG - Success
-- Performing Test LINKER_SUPPORTS_COLOR_DIAGNOSTICS
-- Performing Test LINKER_SUPPORTS_COLOR_DIAGNOSTICS - Failed
-- Looking for os_signpost_interval_begin
-- Looking for os_signpost_interval_begin - not found
-- Found Python3: /usr/bin/python3.9 (found version "3.9.0") found components: Interpreter
-- Linker detection: GNU ld
-- Found Git: /usr/bin/git (found version "2.27.0")
-- Targeting AArch64
-- Targeting AMDGPU
-- Targeting ARM
-- Targeting AVR
-- Targeting BPF
-- Targeting Hexagon
-- Targeting Lanai
-- Targeting Mips
-- Targeting MSP430
-- Targeting NVPTX
-- Targeting PowerPC
-- Targeting RISCV
-- Targeting Sparc
-- Targeting SystemZ
-- Targeting WebAssembly
-- Targeting X86
-- Targeting XCore
-- default linker set to "ld"
-- Performing Test C_SUPPORTS_CF_PROTECTION_BRANCH
-- Performing Test C_SUPPORTS_CF_PROTECTION_BRANCH - Failed
-- Performing Test SPLIT_STACK_FUNCTIONAL
-- Performing Test SPLIT_STACK_FUNCTIONAL - Success
-- starting libgo configuration.
-- Performing Test HAVE_ATOMIC_FUNCTIONS
-- Performing Test HAVE_ATOMIC_FUNCTIONS - Success
-- Looking for clock_gettime
-- Looking for clock_gettime - found
-- Looking for strnlen
-- Looking for strnlen - found
-- Looking for dl_iterate_phdr
-- Looking for dl_iterate_phdr - found
-- Looking for fcntl
-- Looking for fcntl - found
-- Looking for getexecname
-- Looking for getexecname - not found
-- Looking for lstat
-- Looking for lstat - found
-- Looking for readlink
-- Looking for readlink - found
-- Looking for mmap
-- Looking for mmap - found
-- Looking for accept4
-- Looking for accept4 - found
-- Looking for dup3
-- Looking for dup3 - found
-- Looking for epoll_create1
-- Looking for epoll_create1 - found
-- Looking for faccessat
-- Looking for faccessat - found
-- Looking for fallocate
-- Looking for fallocate - found
-- Looking for fchmodat
-- Looking for fchmodat - found
-- Looking for fchownat
-- Looking for fchownat - found
-- Looking for futimesat
-- Looking for futimesat - found
-- Looking for inotify_add_watch
-- Looking for inotify_add_watch - found
-- Looking for inotify_init
-- Looking for inotify_init - found
-- Looking for inotify_init1
-- Looking for inotify_init1 - found
-- Looking for inotify_rm_watch
-- Looking for inotify_rm_watch - found
-- Looking for listxattr
-- Looking for listxattr - found
-- Looking for mincore
-- Looking for mincore - found
-- Looking for mkdirat
-- Looking for mkdirat - found
-- Looking for openat
-- Looking for openat - found
-- Looking for removexattr
-- Looking for removexattr - found
-- Looking for renameat
-- Looking for renameat - found
-- Looking for setxattr
-- Looking for setxattr - found
-- Looking for splice
-- Looking for splice - found
-- Looking for sync_file_range
-- Looking for sync_file_range - found
-- Looking for syscall
-- Looking for syscall - found
-- Looking for tee
-- Looking for tee - found
-- Looking for unlinkat
-- Looking for unlinkat - found
-- Looking for unsetenv
-- Looking for unsetenv - found
-- Looking for unshare
-- Looking for unshare - found
-- Looking for utimensat
-- Looking for utimensat - found
-- Looking for wait4
-- Looking for wait4 - found
-- Looking for open64
-- Looking for open64 - found
-- Looking for mknodat
-- Looking for mknodat - found
-- Looking for pipe2
-- Looking for pipe2 - found
-- Looking for memmem
-- Looking for memmem - found
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Looking for linux/ether.h
-- Looking for linux/ether.h - not found
-- Looking for linux/filter.h
-- Looking for linux/filter.h - found
-- Looking for linux/fs.h
-- Looking for linux/fs.h - found
-- Looking for linux/if_addr.h
-- Looking for linux/if_addr.h - found
-- Looking for linux/if_ether.h
-- Looking for linux/if_ether.h - found
-- Looking for linux/if_tun.h
-- Looking for linux/if_tun.h - found
-- Looking for linux/netlink.h
-- Looking for linux/netlink.h - found
-- Looking for linux/ptrace.h
-- Looking for linux/ptrace.h - found
-- Looking for linux/reboot.h
-- Looking for linux/reboot.h - found
-- Looking for linux/rtnetlink.h
-- Looking for linux/rtnetlink.h - found
-- Looking for memory.h
-- Looking for memory.h - found
-- Looking for net/if.h
-- Looking for net/if.h - found
-- Looking for net/if_arp.h
-- Looking for net/if_arp.h - found
-- Looking for net/route.h
-- Looking for net/route.h - found
-- Looking for netinet/icmp6.h
-- Looking for netinet/icmp6.h - found
-- Looking for netinet/if_ether.h
-- Looking for netinet/if_ether.h - found
-- Looking for netinet/in_systm.h
-- Looking for netinet/in_systm.h - found
-- Looking for netinet/ip.h
-- Looking for netinet/ip.h - found
-- Looking for netinet/ip_mroute.h
-- Looking for netinet/ip_mroute.h - not found
-- Looking for netpacket/packet.h
-- Looking for netpacket/packet.h - found
-- Looking for port.h
-- Looking for port.h - not found
-- Looking for sched.h
-- Looking for sched.h - found
-- Looking for semaphore.h
-- Looking for semaphore.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stdlib.h
-- Looking for stdlib.h - found
-- Looking for strings.h
-- Looking for strings.h - found
-- Looking for sys/epoll.h
-- Looking for sys/epoll.h - found
-- Looking for sys/file.h
-- Looking for sys/file.h - found
-- Looking for sys/inotify.h
-- Looking for sys/inotify.h - found
-- Looking for sys/mount.h
-- Looking for sys/mount.h - found
-- Looking for sys/prctl.h
-- Looking for sys/prctl.h - found
-- Looking for sys/ptrace.h
-- Looking for sys/ptrace.h - found
-- Looking for sys/select.h
-- Looking for sys/select.h - found
-- Looking for sys/statfs.h
-- Looking for sys/statfs.h - found
-- Looking for sys/syscall.h
-- Looking for sys/syscall.h - found
-- Looking for sys/sysinfo.h
-- Looking for sys/sysinfo.h - found
-- Looking for sys/timex.h
-- Looking for sys/timex.h - found
-- Looking for sys/user.h
-- Looking for sys/user.h - found
-- Looking for sys/utsname.h
-- Looking for sys/utsname.h - found
-- Looking for sys/vfs.h
-- Looking for sys/vfs.h - found
-- Looking for syscall.h
-- Looking for syscall.h - found
-- Looking for utime.h
-- Looking for utime.h - found
-- Looking for compress in z
-- Looking for compress in z - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of double
-- Check size of double - done
-- Check size of long double
-- Check size of long double - done
-- Check size of long double
-- Check size of long double - done
-- Check size of void*
-- Check size of void* - done
-- Looking for alloca.h
-- Looking for alloca.h - found
-- Looking for alloca
-- Looking for alloca - not found
-- Looking for memcpy
-- Looking for memcpy - found
-- Performing Test HAVE_SYNC_BOOL_COMPARE_AND_SWAP_4
-- Performing Test HAVE_SYNC_BOOL_COMPARE_AND_SWAP_4 - Success
-- Performing Test HAVE_SYNC_BOOL_COMPARE_AND_SWAP_8
-- Performing Test HAVE_SYNC_BOOL_COMPARE_AND_SWAP_8 - Success
-- Performing Test HAVE_AS_X86_AES
-- Performing Test HAVE_AS_X86_AES - Failed
CMake Error at tools/gollvm/cmake/modules/LibbacktraceUtils.cmake:15 (message):
Libbacktrace config setup not implemented for riscv64
Call Stack (most recent call first):
tools/gollvm/libgo/CMakeLists.txt:45 (setup_libbacktrace)

CMake Error at tools/gollvm/cmake/modules/LibffiUtils.cmake:13 (message):
Arch riscv64 not yet supported
Call Stack (most recent call first):
tools/gollvm/libgo/CMakeLists.txt:49 (setup_libffi)

CMake Error at tools/gollvm/cmake/modules/LibffiUtils.cmake:91 (file):
file COPY cannot find
"/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libffi/src//ffitarget.h":
No such file or directory.
Call Stack (most recent call first):
tools/gollvm/libgo/CMakeLists.txt:49 (setup_libffi)

CMake Error at tools/gollvm/cmake/modules/AutoGenGo.cmake:65 (message):
unsupported arch riscv64: currently only amd64/arm64 support
Call Stack (most recent call first):
tools/gollvm/libgo/CMakeLists.txt:215 (mkversion)

@cagedmantis cagedmantis added this to the Backlog milestone Dec 7, 2020
@cagedmantis
Copy link
Contributor

@cagedmantis cagedmantis commented Dec 7, 2020

/cc @thanm

@thanm
Copy link
Member

@thanm thanm commented Dec 7, 2020

riscv64-unknown-linux-gnu is not a supported configuration for Gollvm at the moment.

It's fine to experiment with doing a build on a riscv64-unknown-linux-gnu system, but the fact that Gollvm is not buildable/runnable on such a system is not a bug. Thanks.

@thanm thanm closed this Dec 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants