Skip to content

Release overlay GCC build fails with "aliased to external symbol" #60481

Open
@liam-clink

Description

@liam-clink

CMake invocation: (C/C++ compilers set to GCC/G++)

cmake -S ../llvm -B . -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$HOME/llvm-15_temp -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_PROJECTS="all"
[1/7688] Building CXX object projects/libc/src/stdlib/CMakeFiles/libc.src.stdlib.bsearch.dir/bsearch.cpp.o
FAILED: projects/libc/src/stdlib/CMakeFiles/libc.src.stdlib.bsearch.dir/bsearch.cpp.o 
/home/liam/gcc-12.2.0/bin/g++ -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/liam/Documents/GitHub/llvm-project/build/projects/libc/src/stdlib -I/home/liam/Documents/GitHub/llvm-project/libc/src/stdlib -I/home/liam/Documents/GitHub/llvm-project/build/include -I/home/liam/Documents/GitHub/llvm-project/llvm/include -I/home/liam/Documents/GitHub/llvm-project/build/projects/libc/include -I/home/liam/Documents/GitHub/llvm-project/libc -I/home/liam/Documents/GitHub/llvm-project/build/projects/libc -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wmisleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -fpie -ffreestanding -fno-builtin -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -DLLVM_LIBC_PUBLIC_PACKAGING -std=c++17 -MD -MT projects/libc/src/stdlib/CMakeFiles/libc.src.stdlib.bsearch.dir/bsearch.cpp.o -MF projects/libc/src/stdlib/CMakeFiles/libc.src.stdlib.bsearch.dir/bsearch.cpp.o.d -o projects/libc/src/stdlib/CMakeFiles/libc.src.stdlib.bsearch.dir/bsearch.cpp.o -c /home/liam/Documents/GitHub/llvm-project/libc/src/stdlib/bsearch.cpp
In file included from /home/liam/Documents/GitHub/llvm-project/libc/src/stdlib/bsearch.cpp:10:
/home/liam/Documents/GitHub/llvm-project/libc/src/stdlib/bsearch.cpp:16:28: error: 'void* __llvm_libc::bsearch(const void*, const void*, size_t, size_t, int (*)(const void*, const void*))' aliased to external symbol 'bsearch'
   16 | LLVM_LIBC_FUNCTION(void *, bsearch,
      |                            ^~~~~~~
/home/liam/Documents/GitHub/llvm-project/libc/src/__support/common.h:33:31: note: in definition of macro 'LLVM_LIBC_FUNCTION'
   33 |   decltype(__llvm_libc::name) name [[gnu::alias(#name)]];                      \
      |                               ^~~~
/home/liam/Documents/GitHub/llvm-project/libc/src/stdlib/bsearch.cpp:16:28: warning: 'void* __llvm_libc::bsearch(const void*, const void*, size_t, size_t, int (*)(const void*, const void*))' specifies less restrictive attribute than its target 'void* bsearch(const void*, const void*, size_t, size_t, __compar_fn_t)': 'nonnull' [-Wmissing-attributes]
   16 | LLVM_LIBC_FUNCTION(void *, bsearch,
      |                            ^~~~~~~
/home/liam/Documents/GitHub/llvm-project/libc/src/__support/common.h:33:31: note: in definition of macro 'LLVM_LIBC_FUNCTION'
   33 |   decltype(__llvm_libc::name) name [[gnu::alias(#name)]];                      \
      |                               ^~~~
In file included from /usr/include/stdlib.h:833,
                 from /home/liam/gcc-12.2.0/include/c++/12.2.0/cstdlib:75,
                 from /home/liam/gcc-12.2.0/include/c++/12.2.0/stdlib.h:36,
                 from /home/liam/Documents/GitHub/llvm-project/libc/src/stdlib/bsearch.h:9,
                 from /home/liam/Documents/GitHub/llvm-project/libc/src/stdlib/bsearch.cpp:9:
/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:20:1: note: 'void* __llvm_libc::bsearch(const void*, const void*, size_t, size_t, int (*)(const void*, const void*))' target declared here
   20 | bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size,
      | ^~~~~~~

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions