Opened 12 years ago

Closed 12 years ago

#620 closed task (fixed)

BUILD Variable

Reported by: Joe Ciccone Owned by: Joe Ciccone
Priority: major Milestone: CLFS Embedded 1.0.0
Component: BOOK Version: CLFS Embedded GIT
Keywords: Cc:


Is the build variable still needed for embedded? It's being used in various places but we never do a multilib build. Wouldn't it make more sense to set this when GCC is built?

Change History (13)

comment:1 Changed 12 years ago by Joe Ciccone

Owner: changed from clfs-commits@… to Joe Ciccone

comment:2 Changed 12 years ago by Andrew Bradford

I'm not sure if it's needed, but if it is, BUILD should be stored in .bashrc right after it is assigned. Other variables are stored in .bashrc rather quickly in case the clfs user logs out, BUILD is not. To change this, I made a patch, available at:

comment:3 Changed 12 years ago by Joe Ciccone

Version: CLFS Embedded 1.0.0CLFS Embedded GIT

comment:4 Changed 12 years ago by Andrew Bradford

If building for ARM aapcs-linux (and I assume aapcs) ABI, the target triplet needs to be "arm-unknown-linux-uclibcgnueabi" or else GCC-Static will not compile. If your target triplet is "arm-unknown-linux-uclibc" then GCC will think you want the OABI (which you don't since you want aapcs-linux [EABA]).

To enable building GCC for a specific ABI, add the --with-abi=CHOSEN_ABI_HERE switch to GCC's configure.

Might also want to include ability to choose floating point (soft vs. hard vs. softfp), arch (ie: armv7-a or another arm version), and tune (ie: build for only Cortex-A8 [subset of armv7-a]). Need to be careful here as older versions of the host's GCC (GCC 4.1.3 for me) may not be able to use all of my examples. <- Needs to be verified

comment:5 Changed 12 years ago by Andrew Bradford

To follow up, errors that will be encountered with ABI choice of aapcs-linux and target triplet of "arm-unknown-linux-uclibc" will look like: error: FPA is unsupported in the AAPCS

If attempting to set ABI when building GCC static, libgcc will fail to build (technically it's during libgcc's configure stage, but you invoke it via a make command). If you try to set the ABI when building e2fsprogs (as directed currently in the book), e2fsprogs's configure will fail.

comment:6 Changed 12 years ago by Andrew Bradford

For x86, specifying --with-abi= when configuring GCC-static ends up giving an error when running "make all-gcc": This target does not support --with-abi. Valid --with options are: arch arch_32 arch_64 cpu cpu_32 cpu_64 tune tune_32 tune_64

It looks like in order to move BUILD to the GCC steps, we'll have to have different GCC instructions for x86 versus arm and mips.

comment:7 Changed 12 years ago by Andrew Bradford

BUILD has been moved to the GCC chapter! (along with some other changes to support this) Please see my clfs-embedded git repo abradford/master commit d5c74180c74610d9d0b31110bd1a338b036c04aa.

Technically, the BUILD variable is gone, replaced with CLFS_ABI (for mips and arm) or CLFS_CPU (for x86). This required building GCC with --with-abi= (for arm and mips) and --with-arch= (for x86). In both cases, BUILD should not be needed when compiling any packages, the GCC created already knows the things that BUILD was standing for.

Note: BUILD was standing for the ABI in arm and mips, but BUILD was standing for 32 or 64 bit-ness in x86. It wasn't consistent. Now it is :)

comment:8 Changed 12 years ago by Joe Ciccone

Will attempt to take a look at the changes at some point during the week.


comment:9 Changed 12 years ago by Joe Ciccone

Your note about BUILD standing for ABI in arm and mips and standing for 32/64 bit-ness in everything else was one of the reason why I wanted to see it changed.


  • Does it make sense to add --with-cpu to each of the builds as well? This is an embedded build, Chances are its being built for a specific piece of hardware. I like the idea of optimizing it for that particular CPU. Or at least explicitly setting the minimum generation.
  • All in all, good changes, Will be merging them in shortly.

Some Notes:

  • x86 Variables Page: CLFS_ENDIAN is being dumped twice, once as CLFS_ENDIAN, again as CLFS_CPU.
  • In some places you have CC="${CC}", really, that statement can just be removed.

comment:10 Changed 12 years ago by Andrew Bradford

Your "Some Notes" have been fixed in my repo, thanks for pointing them out.

Regarding "Thoughts": I agree, but it should go in a different Trac ticket. See ticket #758.

comment:11 Changed 12 years ago by Joe Ciccone

I believe this ticket is done and can be closed, correct?

comment:12 Changed 12 years ago by Andrew Bradford

Yes, I agree that this ticket is done can be closed.

comment:13 Changed 12 years ago by Joe Ciccone

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.