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

llvm@13: drop lldb and use system gcc on Linux #107018

Closed
wants to merge 1 commit into from

Conversation

cho-m
Copy link
Member

@cho-m cho-m commented Aug 1, 2022

  • Have you followed the guidelines for contributing?
  • Have you ensured that your commits follow the commit style guide?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

@BrewTestBot BrewTestBot added legacy Relates to a versioned @ formula long build Set a long timeout for formula testing labels Aug 1, 2022
@BrewTestBot BrewTestBot added the no Linux bottle Formula has no Linux bottle label Aug 1, 2022
@carlocab carlocab mentioned this pull request Aug 2, 2022
@carlocab carlocab added CI-long-timeout [DEPRECATED] Use longer GitHub Actions CI timeout. CI-no-fail-fast Continue CI tests despite failing GitHub Actions matrix builds. labels Aug 2, 2022
@cho-m cho-m marked this pull request as ready for review August 2, 2022 04:24
@cho-m cho-m added do not merge test failure CI fails while running the test-do block linux Linux is specifically affected labels Aug 2, 2022
@carlocab carlocab removed the CI-long-timeout [DEPRECATED] Use longer GitHub Actions CI timeout. label Aug 2, 2022
@carlocab
Copy link
Member

carlocab commented Aug 2, 2022

Not too bothered by the scan-build failure. I'm ok to shipping this without scan-build. Though it's possible the failure is indicative of a problem in clang++, which would be a blocker.

@cho-m
Copy link
Member Author

cho-m commented Aug 3, 2022

If everything else is fine, then we would need a re-run after dropping scan-build and rebasing.

Not sure if there were any other components that would be worth dropping from versioned LLVM. Removing LLDB at least gets rid of Python linkage and makes llvm@13 last version that can be built with GCC-5.

SMillerDev
SMillerDev previously approved these changes Aug 4, 2022
@carlocab
Copy link
Member

carlocab commented Aug 5, 2022

scan-build seems to fail with a similar error in #106755.

@carlocab carlocab mentioned this pull request Aug 5, 2022
6 tasks
@iMichka
Copy link
Member

iMichka commented Aug 5, 2022

This needs to be rebased now that #106755 has been merged.

@cho-m
Copy link
Member Author

cho-m commented Aug 5, 2022

We'll need to disable scan-build (at least the test) to avoid failing. Previous run ignored failure since we temporarily dropped bottles.

@carlocab
Copy link
Member

carlocab commented Aug 5, 2022

So, I guess the question is: is it just scan-build or is something else broken?

@cho-m
Copy link
Member Author

cho-m commented Aug 5, 2022

May be worth checking what is happening in background to see what linker is trying to do.

==> /home/linuxbrew/.linuxbrew/Cellar/llvm@13/13.0.1/bin/scan-build clang++ scanbuildtest.cpp 2>&1
  scan-build: Using '/home/linuxbrew/.linuxbrew/Cellar/llvm@13/13.0.1/bin/clang-13' for static analysis
  /home/linuxbrew/.linuxbrew/bin/ld: /tmp/ccLzUtxD.o: in function `main':
  scanbuildtest.cpp:(.text+0xe): undefined reference to `operator new(unsigned long)'
  /home/linuxbrew/.linuxbrew/bin/ld: scanbuildtest.cpp:(.text+0x28): undefined reference to `operator delete(void*)'

@carlocab
Copy link
Member

carlocab commented Aug 5, 2022

Is there a way to get scan-build to dump verbose logs? e.g. what flags is it passing to the linker?

@cho-m
Copy link
Member Author

cho-m commented Aug 5, 2022

Should be able to pass common verbosity flags to compiler command (-v, -Wl,-v).

Output from local run
$ /home/linuxbrew/.linuxbrew/opt/llvm@13/bin/scan-build clang++ -v -Wl,-v test.cpp
scan-build: Using '/home/linuxbrew/.linuxbrew/Cellar/llvm@13/13.0.1_1/bin/clang-13' for static analysis
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.12' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12)
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/5/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE test.cpp -quiet -dumpbase test.cpp -mtune=generic -march=x86-64 -auxbase test -version -fstack-protector-strong -Wformat -Wformat-security -o /tmp/ccMefEge.s
GNU C++ (Ubuntu 5.4.0-6ubuntu1~16.04.12) version 5.4.0 20160609 (x86_64-linux-gnu)
	compiled by GNU C version 5.4.0 20160609, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/5"
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/5/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/5
 /usr/include/x86_64-linux-gnu/c++/5
 /usr/include/c++/5/backward
 /usr/lib/gcc/x86_64-linux-gnu/5/include
 /usr/local/include
 /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
GNU C++ (Ubuntu 5.4.0-6ubuntu1~16.04.12) version 5.4.0 20160609 (x86_64-linux-gnu)
	compiled by GNU C version 5.4.0 20160609, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 85af4995304287cdd19cfa43cf5d6cf1
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=x86-64'
 as -v --64 -o /tmp/cceg1LI8.o /tmp/ccMefEge.s
GNU assembler version 2.38 (x86_64-pc-linux-gnu) using BFD version (GNU Binutils) 2.38
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/ccXUNBd3.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. -v /tmp/cceg1LI8.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o
collect2 version 5.4.0 20160609
/home/linuxbrew/.linuxbrew/bin/ld -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/ccXUNBd3.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. -v /tmp/cceg1LI8.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o
GNU ld (GNU Binutils) 2.38
/home/linuxbrew/.linuxbrew/bin/ld: /tmp/cceg1LI8.o: in function `main':
test.cpp:(.text+0xe): undefined reference to `operator new(unsigned long)'
/home/linuxbrew/.linuxbrew/bin/ld: test.cpp:(.text+0x28): undefined reference to `operator delete(void*)'
/home/linuxbrew/.linuxbrew/bin/ld: test.cpp:(.text+0x35): undefined reference to `std::cout'
/home/linuxbrew/.linuxbrew/bin/ld: test.cpp:(.text+0x3a): undefined reference to `std::ostream::operator<<(int)'
/home/linuxbrew/.linuxbrew/bin/ld: test.cpp:(.text+0x3f): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)'
/home/linuxbrew/.linuxbrew/bin/ld: test.cpp:(.text+0x47): undefined reference to `std::ostream::operator<<(std::ostream& (*)(std::ostream&))'
/home/linuxbrew/.linuxbrew/bin/ld: /tmp/cceg1LI8.o: in function `__static_initialization_and_destruction_0(int, int)':
test.cpp:(.text+0x75): undefined reference to `std::ios_base::Init::Init()'
/home/linuxbrew/.linuxbrew/bin/ld: test.cpp:(.text+0x84): undefined reference to `std::ios_base::Init::~Init()'
collect2: error: ld returned 1 exit status
scan-build: Analysis run complete.
scan-build: Removing directory '/tmp/scan-build-2022-08-05-160650-18380-1' because it contains no reports.
scan-build: No bugs found.

I think llvm@12 uses #{bin}/clang++ to force Clang compiler. Can reproduce error with llvm@12.

@BrewTestBot BrewTestBot removed the no Linux bottle Formula has no Linux bottle label Aug 5, 2022
@cho-m cho-m added CI-long-timeout [DEPRECATED] Use longer GitHub Actions CI timeout. and removed do not merge labels Aug 6, 2022
@cho-m cho-m mentioned this pull request Aug 6, 2022
6 tasks
@carlocab carlocab removed the CI-long-timeout [DEPRECATED] Use longer GitHub Actions CI timeout. label Aug 6, 2022
@BrewTestBot
Copy link
Member

🤖 A scheduled task has triggered a merge.

@cho-m cho-m deleted the llvm@13-no-lldb branch August 6, 2022 15:58
@cho-m cho-m mentioned this pull request Aug 7, 2022
6 tasks
@github-actions github-actions bot added the outdated PR was locked due to age label Sep 6, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CI-no-fail-fast Continue CI tests despite failing GitHub Actions matrix builds. legacy Relates to a versioned @ formula linux Linux is specifically affected long build Set a long timeout for formula testing outdated PR was locked due to age test failure CI fails while running the test-do block
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants