0

I've been using the BR2_PACKAGE_OVERRIDE_FILE + <pkg>_OVERRIDE_SRCDIR settings in Buildroot 2018.05 to successfully track packages of interest such as Binutils and glibc as submodules my projet:

BINUTILS_OVERRIDE_SRCDIR = ../../submodules/binutils-gdb
GLIBC_OVERRIDE_SRCDIR = ../../submodules/glibc

However, when I tried an analogous procedure for GCC, it didn't seem to take effect:

GCC_OVERRIDE_SRCDIR = ../../submodules/gcc

For example, under build/ in the build folder, I get the usual:

host-gcc-final-7.3.0
host-gcc-initial-7.3.0

instead of the expected -custom versions.

Is there a way to achieve it?

Maybe http://buildroot-busybox.2317881.n4.nabble.com/Internal-toolchain-wrapper-ccache-fixes-tp113064p113187.html implies that it is just an exception for GCC due to technical reasons, but that thread is a few years old now, and I didn't fully try to understand it yet.

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985

1 Answers1

1

gcc is not an actual package. It consists of two packages that share some configuration: gcc-initial and gcc-final. Thus, you have to set

GCC_INITIAL_OVERRIDE_SRCDIR = ../../submodules/gcc
GCC_FINAL_OVERRIDE_SRCDIR = ../../submodules/gcc

or, to factor it a little in the same way as the in-tree packages do it:

GCC_OVERRIDE_SRCDIR = ../../submodules/gcc
GCC_INITIAL_OVERRIDE_SRCDIR = $(GCC_OVERRIDE_SRCDIR)
GCC_FINAL_OVERRIDE_SRCDIR = $(GCC_OVERRIDE_SRCDIR)
Arnout
  • 2,927
  • 16
  • 24
  • Ah, thanks Arnout! I should have tried that. It is going to be beautiful. The only missing thing now for perfection is not needing to build from SRCDIR out of tree instead of ugly rsync. – Ciro Santilli OurBigBook.com Mar 05 '19 at 22:56