tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Clang vs. GCC arm

Despite the subject matter, this is more of a tools related message rather than a toolchain one.

As things stand right now, the ARM toolchain cannot be cross compiled from macOS because a bit of machine generated code inside GCC ends up with more nested parentheses than the standards recommend and this trips a soft limit in Clang. This appears to be in hand, PRs have apparently been filed with GCC and Clang, and the consensus seems to be that GCC should generate such stupid code.

That’s all well and good, but I want to compile stuff now. I figured I could convince the build to pass the right flag to Clang to increase the parentheses limit, or I could not use Clang. I went with the “not use Clang” option because there are plenty of GCCs in pkgsrc.

The tools Makefiles and maybe some other stuff kept trying to pass a Clang option to gcc and this didn’t work so well. The following code fragment is littered throughout the tools tree, with at least one variant.

	# Disable use of pre-compiled headers on Darwin.
	.if ${BUILD_OSTYPE} == "Darwin"
	CPPFLAGS+=    -no-cpp-precomp

I needed to nuke this in every location order to build with GCC. 

Is there a right way to centralise this? I’ve noticed that FreeBSD and Solaris hosted builds might also benefit from this, although to a lesser extent.


Home | Main Index | Thread Index | Old Index