Forums - LLVM 8.0.6 SDCLANG location

7 posts / 0 new
Last post
LLVM 8.0.6 SDCLANG location
Squida
Join Date: 2 Mar 21
Posts: 6
Posted: Sat, 2021-03-27 23:08

Hello everyone, I have been trying to build a rom for SM6150 Xiaomi Note 10 PRO (Tucana CC9 PRO).

Things I have done so far.

1. Download tucana android 10 source from Xiaomi MiCode github.

2. Using the LA.UM.8.9.r1-03800-sm6150.0 tag on codeaurora to download the release branch of LA.UM.8.9.r1-03800-sm6150.0.xml as the manifest. Downloaded 729 files.

3. going off of Mi Code github wiki section how to use. I follow it exactly.

LINK: https://github.com/MiCode/Xiaomi_Kernel_OpenSource/wiki/How-To-Use

In the guide above it says to remove all files from kernel folder and replace it with your devices kernel, job done. (backed up kernel files before deleting just incase) and it was good that I did, needed the config folder in the devices source kernel folder. the guide does not mention it.

So fixed all that and then copied the tucana_user_defconfig file from arch/arm64/config/vendor back one folder in config where the defconfig file is already at.

Went to SM6150 in devices, qcom and edited AndroidBoard.mk to replace the Defconfig with the tucana_user_defconfig.

commands as follows.

source build/envsetup.sh
lunch 29
make bootimage -j4

 

It fails asking for SDCLAN_PATH, I checked all threads here and on xda. people say to move qcom LLVM compiler to SDCLANG in clang's directory.

problem is, the clang directory is numbered and I do not see the folder SDCLANG on LLVM 8.0.6 or any of the other LLVM compilers.

Where do i get SDCLANG and how come there is no actual guide on this subject apart from old ones.

Any help will be much appreciated.

  • Up0
  • Down0
Squida
Join Date: 2 Mar 21
Posts: 6
Posted: Sun, 2021-03-28 12:31

Also found the section that looks for it in global.go still not sure how or what to add.

    // Sanity check SDCLANG_PATH
    if envPath := android.SdclangEnv["SDCLANG_PATH"]; sdclangPath == "" && envPath == "" {
        panic("SDCLANG_PATH can not be empty")
    }

    // Sanity check SDCLANG_PATH_2
    if envPath := android.SdclangEnv["SDCLANG_PATH_2"]; sdclangPath2 == "" && envPath == "" {
        panic("SDCLANG_PATH_2 can not be empty")

  • Up0
  • Down0
Squida
Join Date: 2 Mar 21
Posts: 6
Posted: Mon, 2021-03-29 15:17

Error

============================================
[ 57% 47/82] test android/soong/cc/config
FAILED: out/soong/.bootstrap/soong-cc-config/test/test.passed
out/soong/.bootstrap/bin/gotestrunner -p ./build/soong/cc/config -f out/soong/.bootstrap/soong-cc-config/test/test.passed -- out/soong/.bootstrap/soong-cc-config/test/test -test.short
open : no such file or directory
panic: SDCLANG_PATH can not be empty

goroutine 1 [running]:
android/soong/cc/config.setSdclangVars()
    /home/avm/dev/rom/codeaurora/build/soong/cc/config/global.go:362 +0x1816
android/soong/cc/config.init.1()
    /home/avm/dev/rom/codeaurora/build/soong/cc/config/global.go:200 +0x92c
09:19:15 soong bootstrap failed with: exit status 1

#### failed to build some targets (2 seconds) ####

#### hidl-gen compilation failed, check above errors ####

There is no guide at all pointing to the location of the file for where it shows SDCLANG variable for me to change.

WHERE IS IT!!!!!!!

 

I downloaded all of QAEP for  Release branch and manifest LA.UM.7.9.r1-05700-sm6150.0.xml

All downloaded and all was good but SDCLANG does not exist neither does the folder itself in QAEP or even LLVM Compiler.

 

  • Up0
  • Down0
timothy.shewcraft
Join Date: 9 Oct 20
Posts: 3
Posted: Mon, 2021-04-19 13:32

Create an sdclang directory in prebuilts/clang/host/linux-x86/

# mkdir $(TOP_DIR)/prebuilts/clang/host/linux-x86/sdclang-8

Copy the compiler into this directory.  (We'll call wherever you unpacked the compiler $LLVM_DIR.)

# cp $(LLVM_DIR)/toolchains/llvm-Snapdragon_LLVM_for_Android_8.0/prebuilt/linux-x86_64/* $(TOP_DIR)/prebuilts/clang/host/linux-x86/sdclang-8/

Add to your BoardConfig.mk file:


# SDClang Config
ifneq ($(HOST_OS),darwin)
SDCLANG := true 
SDCLANG_PATH := prebuilts/clang/host/linux-x86/sdclang-8/bin
SDCLANG_PATH_2 := prebuilts/clang/host/linux-x86/sdclang-8/bin
SDCLANG_LTO_DEFS := device/qcom/common/sdllvm-lto-defs.mk
endif
 
 
Then set the environment
# export SDCLANG_PATH=prebuilts/clang/host/linux-x86/sdclang-8/bin
# export SDCLANG_PATH_2=prebuilts/clang/host/linux-x86/sdclang-8/bin
 
 
That's at least how you get your sdclang paths defined.  I'm building a different device/chipset, but the above is necessary regardless to enable the compiler.  I'm still running into errors after this, but that's where our solutions will be different.  If you get more errors that give specific files, look through the github repo and compare your file to the files there.  I've used this to overcome a number of issues that I've ran into
 
  • Up0
  • Down0
Squida
Join Date: 2 Mar 21
Posts: 6
Posted: Wed, 2021-04-21 00:20

Thank you very much. I'll try it out and see how it goes.

  • Up0
  • Down0
Squida
Join Date: 2 Mar 21
Posts: 6
Posted: Wed, 2022-01-19 21:52

Thank you once again, it worked. Started building!

But now I get this, been trying to track down on what it requires.

OUT_DIR=out
============================================
[100% 12236/12236] out/soong/.bootstrap/bin/soong_build out/soong/build.ninja
FAILED: out/soong/build.ninja
out/soong/.bootstrap/bin/soong_build -t -l out/.module_paths/Android.bp.list -b out/soong -n out -d out/soong/build.ninja.d -globFile out/soong/.bootstrap/build-globs.ninja -o out/soong/build.ninja Android.bp
open : no such file or directory
error: vendor/qcom/opensource/commonsys/cryptfs_hw/Android.bp:16:1: "libcryptfs_hw" depends on undefined module "libcryptfshw_hidl_headers"
error: vendor/qcom/opensource/commonsys/cryptfs_hw/Android.bp:16:1: "libcryptfs_hw" depends on undefined module "[email protected]"
16:31:37 soong bootstrap failed with: exit status 1

#### failed to build some targets (20 seconds) ####

 I am so close, I think its got to do with mmodules but not exactly sure on what it needs. it does say it built with success, but then goes on to modules and this error comes up. Maybe it is normal. Not sure though, Rather have some verification to be sure.

 

(MAYBE FIX)

go to the Android.bp file located at ROOT_BUILD_DIR/vendor/qcom/opensource/interfaces/Android.bp

Scroll to the bottom of the document and add this.

#########################################

hidl_package_root {
    name: "vendor.qti.hardware.cryptfshw",
    path: "vendor/qcom/opensource/commonsys/cryptfs_hw",
}

##########################################

 

******************NEW ERROR*************

[100% 1/1] out/soong/.minibootstrap/minibp out/soong/.bootstrap/build.ninja
[ 50% 2/4] glob vendor/qcom/opensource/interfaces/NOTICE
[ 75% 3/4] glob vendor/qcom/opensource/interfaces/current.txt
[100% 4/4] out/soong/.bootstrap/bin/soong_build out/soong/build.ninja
FAILED: out/soong/build.ninja
out/soong/.bootstrap/bin/soong_build -t -l out/.module_paths/Android.bp.list -b out/soong -n out -d out/soong/build.ninja.d -globFile out/soong/.bootstrap/build-globs.ninja -o out/soong/build.ninja Android.bp
open : no such file or directory
error: vendor/qcom/opensource/commonsys/cryptfs_hw/Android.bp:16:1: dependency "[email protected]" of "libcryptfs_hw" missing variant:
  arch:android_arm64_armv8-a, image:core, link:shared, version:
available variants:
 
ninja: build stopped: subcommand failed.
12:00:27 soong bootstrap failed with: exit status 1

#### failed to build some targets (10 seconds) ####

#### hidl-gen compilation failed, check above errors ####

 

  • Up0
  • Down0
mengdiz
Join Date: 6 Dec 21
Posts: 27
Posted: Tue, 2022-02-08 23:01

Hi,

It means you miss [email protected], you should download private code from qcom chipcode, but it needs chipcode account.

https://chipcode.qti.qualcomm.com/

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.