Tencent / yadcc

Yet Another Distributed C++ Compiler. yadcc是一套腾讯广告自研的分布式编译系统,用于支撑腾讯广告的日常开发及流水线。相对于已有的同类解决方案,我们针对实际的工业生产环境做了性能、可靠性、易用性等方面优化。
Other
364 stars 62 forks source link

can not support CROSS_COMPILE #56

Open mathslimin opened 1 year ago

mathslimin commented 1 year ago

compile linux kernel use cross_compile like this

export ARCH=arm64
export CROSS_COMPILE=aarch64-none-linux-gnu-
make  menuconfig  ARCH=arm64  CROSS_COMPILE=$CROSS_COMPILE
make ARCH=arm64 CROSS_COMPILE=$CROSS_COMPILE -j$(nproc) zImage

yadcc can not support it

0x804d8000 commented 1 year ago

IIRC if CROSS_COMPILE is specified, make invokes whatever compiler pointed by this argument, rather than the plain GCC. So I suspect in your build process yadcc is not invoked at all.

Besides, due to the way yadcc works and how fast C code compiles, using yadcc to speed up Linux kernel building process may not see a huge speed up. Last time I try this it gives me about 2x speed up, but that’s it - It was far from what I’d expect from a linear boost.

mathslimin commented 1 year ago

icecream support Cross-Compiling, https://github.com/icecc/icecream Do we have plans to support arm64 cross-compilation? Or provide related documents.

mathslimin commented 1 year ago

ADBCC_LOG_LEVEL=0 ADBCC_COMPILE_ON_CLOUD_SIZE_THRESHOLD=0 /opt/buildtools/adbcc_client/bin/adbcc-cxx aarch64-none-linux-gnu-gcc helloworld.c -c task_dispatcher.cc:327] Unrecognized compilation environment [] is requested by .

0x804d8000 commented 1 year ago

I couldn’t see much difference between cross compilation and a native one regarding distributed compilation.

However, from the log you provided, the compile cluster seemed fail to recognize the compiler. This may have something to do with how compiler is found on compile server.

Because cross-compiler’s executable is usually prefixed with a target triplet, it’s unlikely to be recognized by what’s currently implemented.

Try adding your compiler executable name there and see if that makes any difference.

We may need to reimplement compiler-scanning by enumerating executables and check their suffix, instead of hardcoding executable names.

mathslimin commented 1 year ago

fix it by compiler_registry.cc static constexpr auto kCompilerExecutables = {"gcc", "g++", "aarch64-none-linux-gnu-gcc", "aarch64-none-linux-gnu-g++", "arm-none-linux-gnueabihf-gcc", "arm-none-linux-gnueabihf-g++", // I'm not sure if we support Clang, TBH. "clang", "clang++"};

0x804d8000 commented 1 year ago

reopening as this needs improvement in the future.

LeoZhang07 commented 2 months ago

fix it by compiler_registry.cc static constexpr auto kCompilerExecutables = {"gcc", "g++", "aarch64-none-linux-gnu-gcc", "aarch64-none-linux-gnu-g++", "arm-none-linux-gnueabihf-gcc", "arm-none-linux-gnueabihf-g++", // I'm not sure if we support Clang, TBH. "clang", "clang++"};

does it work?

CrazyWood2020 commented 2 months ago

邮件已收到,本回复为自动回复,我将尽快与您取得联系,谢谢!