Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not build under gcc-less linux #640

Open
z-erica opened this issue Jan 13, 2024 · 4 comments
Open

can not build under gcc-less linux #640

z-erica opened this issue Jan 13, 2024 · 4 comments

Comments

@z-erica
Copy link

z-erica commented Jan 13, 2024

plan9port/bin/9c

Lines 115 to 122 in be7c68f

*Linux*) usegcc
case "${CC9:-gcc}" in
tcc)
cc=tcc
cflags="-c -g"
;;
esac
;;

some linux distributions (e.g. chimera linux) use clang as a default toolchain. this means 9c can't be used as is

@JamesParrott
Copy link

What happens when clang is used to compile plan 9 instead?

@z-erica
Copy link
Author

z-erica commented Jan 15, 2024

i believe it works fine; the main issue is that i had to patch this file for anything to run in the first place

@JamesParrott
Copy link

JamesParrott commented Jan 15, 2024

Great. I see the problem now. The Linux branch only checks CC9 against tcc. There's plenty of code there to support clang on other platforms already. As you know it already works, are you allowed to share, or even contribute your patch?

Otherwise, if something else is already setting CC9 to clang, and if useclang works on Linux just as well as on BSDs, would something like the new code below suffice, to treat Linux clang the same as Dragon clang and BSD clang?

case "$tag" in
*DragonFly*gcc*|*BSD*gcc*)	usegcc ;;
*DragonFly*clang|*BSD*clang*|*Linux*clang*)	useclang ;;
*Darwin*)
		useclang
		cflags="$cflags -g3 -m64"
		;;
*HP-UX*)	cc=${CC9:-cc}; cflags="-g -O -c -Ae" ;;
*Linux*)	usegcc
		case "${CC9:-gcc}" in
		tcc)
			cc=tcc
			cflags="-c -g"
			;;
		esac
		;;

@z-erica
Copy link
Author

z-erica commented Jan 15, 2024

it should suffice, yes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants