Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upcompile AOSP with CodeQL #47
Comments
|
Thank you very much for this report. To help triage can you please:
I note that macOS instructions for AOSP suggest building on a separate volume via a sparse disk-image due to case-sensitivity issues. If you are doing this can I suggest that you monitor the space available on this build volume as the CodeQL database will take a substantial amount of room. The CodeQL database does not need to live on the same volume as the build - so feel free to put it elsewhere (I usually use /tmp). And finally, what happens if you run: TEMPORARY_DISABLE_PATH_RESTRICTIONS=true codeql database create /tmp/new-database2 --language=java --command='make services'(This disables some new restrictions AOSP is adding - see https://android.googlesource.com/platform/build/+/master/Changes.md#PATH_Tools). |
|
Hi Mat, thanks for the quick response! |
|
Thank you for the update. I have managed to reproduce the original issue with AOSP master ( I have not managed to reproduce the second issue yet. |
|
Hi Matt, can I do something to help you reproduce the second issue? |
|
@to-the-batmobile: I'm interested in the following behaviours:
I'd like to know what that says.
|
|
For reference here are the commands I have been using to try and reproduce (cribbed from https://source.android.com/setup): # Install dependencies - Linux Only
sudo apt-get install git-core gnupg flex bison build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev libxml2-utils xsltproc unzip fontconfig
# Set disk and install dependencies (macOS only)
hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 250g ~/android.dmg.sparseimage
brew install git gnupg2
# Install repo
LOCAL_BIN=$HOME/bin
mkdir -p ${LOCAL_BIN}
PATH=${LOCAL_BIN}:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ${LOCAL_BIN}/repo
chmod a+x ${LOCAL_BIN}/repo
# macOS setup for each session
hdiutil attach ~/android.dmg.sparseimage -mountpoint /Volumes/android;
ulimit -S -n 1024
cd /Volumes/android
# Download source
# Make sure you have >250 GB free....
mkdir aosp
cd aosp
repo init -u https://android.googlesource.com/platform/manifest
# The -j here really is limited by your network bandwidth...
repo sync -c -j4
# Make a cup of tea
# Do a build under CodeQL
source build/envsetup.sh
# For my checkout of AOSP `make` has been made an alias - the `-c` option here is an expansion of that alias.
codeql database create -l java -c "`pwd`/build/soong/soong_ui.bash --make-mode -j1 services" /tmp/aosp-db-java |
|
@matt-gretton-dann |
|
The disk usage is enough, I also compiled it successfully without codeql |
|
(Note: Matt is out of office but may be able to get back to this next week). |
|
@hmakholm Thanks! is there a possibility that one of you guys may be able to take a quick look into this? I bet it's encoding/parsing-related issues... I'm trying to dig into the code and realize by myself but I think you might be able to also assist regarding this issue. |
Hi
I'm trying to run CodeQL on AOSP with this command:
codeql database create new-database --language=java --command='make services'but i'm getting this error while building:
[build] /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: out/soong/.intermediates/external/libcxx/libc++_static/darwin_x86_64_static/libc++_static.a(cxa_unexpected.o) has no symbols [build] /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: out/soong/.intermediates/external/libcxx/libc++_static/darwin_x86_64_static/libc++_static.a(typeinfo.o) has no symbols [build] 17:09:55 Disallowed PATH tool "otool" used: []string{"otool", "-l", "/Volumes/v0/AOSP/new-database/working/copy-root/000001F7/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld.semmle.00013D12"} [build] 17:09:55 See https://android.googlesource.com/platform/build/+/master/Changes.md#PATH_Tools for more information. [build] 17:09:55 Process tree: [build] 17:09:55 → working/copy-root/000001F7/Volumes/v0/AOSP/out/soong_ui /Volumes/v0/AOSP/out/soong_ui -j1 --make-mode [build] 17:09:55 → prebuilts/build-tools/darwin-x86/bin/ninja -d keepdepfile --frontend_file out/.ninja_fifo services -j 1 -f out/combined-aosp_sargo.ninja -w dupbuild=err -w missingdepfile=err [build] 17:09:55 → prebuilts/clang/host/darwin-x86/clang-r353983c/bin/clang++.real @out/soong/.intermediates/external/libcxx/libc++/darwin_x86_64_shared/libc++.dylib.rsp -force_load out/soong/.intermediates/external/libcxx/libc++_static/darwin_x86_64_static/libc++_static.a -o out/soong/.intermediates/external/libcxx/libc++/darwin_x86_64_shared/libc++.dylib -dynamiclib -single_module -install_name @rpath/libc++.dylib -target x86_64-apple-darwin -B/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -mmacosx-version-min=10.8 -m64 -ldl -lpthread -lm -nodefaultlibs -Wl,-undefined,dynamic_lookup -Wl,-rpath,@loader_path/../lib64 -Wl,-rpath,@loader_path/lib64 -nodefaultlibs -lc -lSystem -Wl,-unexported_symbols_list,external/libcxx/lib/libc++unexp.exp -Wl,-force_symbols_not_weak_list,external/libcxx/lib/notweak.exp -Wl,-force_symbols_weak_list,external/libcxx/lib/weak.exp [build] 17:09:55 → /usr/bin/python /Users/user/codeql-home/codeql/tools/osx64/relocator.py /Users/user/codeql-home/codeql/tools/osx64/unsign /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld /Volumes/v0/AOSP/new-database/working/copy-root/000001F7/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld.semmle.00013D12 /Volumes/v0/AOSP/new-database/working/copy-root/000001F7/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld [build] 17:09:55 → otool -l /Volumes/v0/AOSP/new-database/working/copy-root/000001F7/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld.semmle.00013D12 [build] [ 27% 878/3224] //external/libcxx:libc++ link libc++.dylib [darwin] [build] FAILED: out/soong/.intermediates/external/libcxx/libc++/darwin_x86_64_shared/libc++.dylib [build] prebuilts/clang/host/darwin-x86/clang-r353983c/bin/clang++ @out/soong/.intermediates/external/libcxx/libc++/darwin_x86_64_shared/libc++.dylib.rsp -force_load out/soong/.intermediates/external/libcxx/libc++_static/darwin_x86_64_static/libc++_static.a -o out/soong/.intermediates/external/libcxx/libc++/darwin_x86_64_shared/libc++.dylib -dynamiclib -single_module -install_name @rpath/libc++.dylib -target x86_64-apple-darwin -B/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -mmacosx-version-min=10.8 -m64 -ldl -lpthread -lm -nodefaultlibs -Wl,-undefined,dynamic_lookup -Wl,-rpath,@loader_path/../lib64 -Wl,-rpath,@loader_path/lib64 -nodefaultlibs -lc -lSystem -Wl,-unexported_symbols_list,external/libcxx/lib/libc++unexp.exp -Wl,-force_symbols_not_weak_list,external/libcxx/lib/notweak.exp -Wl,-force_symbols_weak_list,external/libcxx/lib/weak.exp [build] dyld: Library not loaded: @rpath/libtapi.dylib [build] Referenced from: /Volumes/v0/AOSP/new-database/working/copy-root/000001F7/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld [build] Reason: image not found [build] clang-9: error: unable to execute command: Abort trap: 6 [build] clang-9: error: linker command failed due to signal (use -v to see invocation) [build] ninja: build stopped: subcommand failed. [build] 17:09:55 ninja failed with: exit status 1 [build-err] make: *** [run_soong_ui] Error 1 [ERROR] Spawned process exited abnormally (code 2; tried to run: [/Users/user/codeql-home/codeql/tools/osx64/preload_tracer, make, services]) A fatal error occurred: Exit status 2 from command: [make, services]Thanks for your help in advance