Fossil User Forum

Scope of CC/CXX
Login

Scope of CC/CXX

Scope of CC/CXX

(1) By Barak A. Pearlmutter (barak_pearlmutter) on 2025-04-10 12:30:17 [source]

In compiling 2.25 with

export CC=clang
export CXX=clang++
for riscv64, as shown here, the build uses clang for the fossil executable itself, but uses cc for building some support executables. Here is a snippet:

make[1]: Entering directory '/build/reproducible-path/fossil-2.25'
mkdir bld
cc -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/fossil-2.25=. -fstack-protector-strong -Wformat -Werror=format-security -I/build/reproducible-path/fossil-2.25/compat/tcl-8.6/generic -o bld/translate ./tools/translate.c
cc -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/fossil-2.25=. -fstack-protector-strong -Wformat -Werror=format-security -I/build/reproducible-path/fossil-2.25/compat/tcl-8.6/generic -o bld/mkindex ./tools/mkindex.c
cc -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/fossil-2.25=. -fstack-protector-strong -Wformat -Werror=format-security -I/build/reproducible-path/fossil-2.25/compat/tcl-8.6/generic -o bld/mkbuiltin ./tools/mkbuiltin.c
cc -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/fossil-2.25=. -fstack-protector-strong -Wformat -Werror=format-security -I/build/reproducible-path/fossil-2.25/compat/tcl-8.6/generic -o bld/makeheaders ./tools/makeheaders.c
cc -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/fossil-2.25=. -fstack-protector-strong -Wformat -Werror=format-security -I/build/reproducible-path/fossil-2.25/compat/tcl-8.6/generic -o bld/mkversion ./tools/mkversion.c
# Force rebuild of VERSION.h every time we run "make"
cc -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/fossil-2.25=. -fstack-protector-strong -Wformat -Werror=format-security -I/build/reproducible-path/fossil-2.25/compat/tcl-8.6/generic -o bld/codecheck1 ./tools/codecheck1.c
clang -I. -I./src -I./extsrc -Ibld -Wall -Wdeclaration-after-statement -DFOSSIL_ENABLE_JSON -DFOSSIL_ENABLE_TH1_DOCS -DFOSSIL_ENABLE_TH1_HOOKS -DFOSSIL_DYNAMIC_BUILD=1 -I/build/reproducible-path/fossil-2.25/compat/tcl-8.6/generic -DFOSSIL_HAVE_FUSEFS -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/fossil-2.25=. -fstack-protector-strong -Wformat -Werror=format-security -I/build/reproducible-path/fossil-2.25/compat/tcl-8.6/generic -DHAVE_AUTOCONFIG_H  -DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0 -DHAVE_USLEEP   \
	-c ./extsrc/sqlite3.c -o bld/sqlite3.o
clang -I. -I./src -I./extsrc -Ibld -Wall -Wdeclaration-after-statement -DFOSSIL_ENABLE_JSON -DFOSSIL_ENABLE_TH1_DOCS -DFOSSIL_ENABLE_TH1_HOOKS -DFOSSIL_DYNAMIC_BUILD=1 -I/build/reproducible-path/fossil-2.25/compat/tcl-8.6/generic -DFOSSIL_HAVE_FUSEFS -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/fossil-2.25=. -fstack-protector-strong -Wformat -Werror=format-security -I/build/reproducible-path/fossil-2.25/compat/tcl-8.6/generic -DHAVE_AUTOCONFIG_H  -c ./extsrc/linenoise.c -o bld/linenoise.o
clang -I. -I./src -I./extsrc -Ibld -Wall -Wdeclaration-after-statement -DFOSSIL_ENABLE_JSON -DFOSSIL_ENABLE_TH1_DOCS -DFOSSIL_ENABLE_TH1_HOOKS -DFOSSIL_DYNAMIC_BUILD=1 -I/build/reproducible-path/fossil-2.25/compat/tcl-8.6/generic -DFOSSIL_HAVE_FUSEFS -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/fossil-2.25=. -fstack-protector-strong -Wformat -Werror=format-security -I/build/reproducible-path/fossil-2.25/compat/tcl-8.6/generic -DHAVE_AUTOCONFIG_H  -DPIKCHR_TOKEN_LIMIT=10000 -c ./extsrc/pikchr.c -o bld/pikchr.o
clang -I. -I./src -I./extsrc -Ibld -Wall -Wdeclaration-after-statement -DFOSSIL_ENABLE_JSON -DFOSSIL_ENABLE_TH1_DOCS -DFOSSIL_ENABLE_TH1_HOOKS -DFOSSIL_DYNAMIC_BUILD=1 -I/build/reproducible-path/fossil-2.25/compat/tcl-8.6/generic -DFOSSIL_HAVE_FUSEFS -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/fossil-2.25=. -fstack-protector-strong -Wformat -Werror=format-security -I/build/reproducible-path/fossil-2.25/compat/tcl-8.6/generic -DHAVE_AUTOCONFIG_H  -DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0 -DHAVE_USLEEP -Dmain=sqlite3_shell -DSQLITE_SHELL_IS_UTF8=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=1 -DSQLITE_SHELL_DBNAME_PROC=sqlcmd_get_dbname -DSQLITE_SHELL_INIT_PROC=sqlcmd_init_proc   -DHAVE_LINENOISE=2 -c ./extsrc/shell.c -o bld/shell.o
clang -I. -I./src -I./extsrc -Ibld -Wall -Wdeclaration-after-statement -DFOSSIL_ENABLE_JSON -DFOSSIL_ENABLE_TH1_DOCS -DFOSSIL_ENABLE_TH1_HOOKS -DFOSSIL_DYNAMIC_BUILD=1 -I/build/reproducible-path/fossil-2.25/compat/tcl-8.6/generic -DFOSSIL_HAVE_FUSEFS -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/fossil-2.25=. -fstack-protector-strong -Wformat -Werror=format-security -I/build/reproducible-path/fossil-2.25/compat/tcl-8.6/generic -DHAVE_AUTOCONFIG_H  -c ./src/th.c -o bld/th.o
clang -I. -I./src -I./extsrc -Ibld -Wall -Wdeclaration-after-statement -DFOSSIL_ENABLE_JSON -DFOSSIL_ENABLE_TH1_DOCS -DFOSSIL_ENABLE_TH1_HOOKS -DFOSSIL_DYNAMIC_BUILD=1 -I/build/reproducible-path/fossil-2.25/compat/tcl-8.6/generic -DFOSSIL_HAVE_FUSEFS -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/fossil-2.25=. -fstack-protector-strong -Wformat -Werror=format-security -I/build/reproducible-path/fossil-2.25/compat/tcl-8.6/generic -DHAVE_AUTOCONFIG_H  -c ./src/th_lang.c -o bld/th_lang.o
clang -I. -I./src -I./extsrc -Ibld -Wall -Wdeclaration-after-statement -DFOSSIL_ENABLE_JSON -DFOSSIL_ENABLE_TH1_DOCS -DFOSSIL_ENABLE_TH1_HOOKS -DFOSSIL_DYNAMIC_BUILD=1 -I/build/reproducible-path/fossil-2.25/compat/tcl-8.6/generic -DFOSSIL_HAVE_FUSEFS -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/fossil-2.25=. -fstack-protector-strong -Wformat -Werror=format-security -I/build/reproducible-path/fossil-2.25/compat/tcl-8.6/generic -DHAVE_AUTOCONFIG_H  -c ./src/th_tcl.c -o bld/th_tcl.o
clang -I. -I./src -I./extsrc -Ibld -Wall -Wdeclaration-after-statement -DFOSSIL_ENABLE_JSON -DFOSSIL_ENABLE_TH1_DOCS -DFOSSIL_ENABLE_TH1_HOOKS -DFOSSIL_DYNAMIC_BUILD=1 -I/build/reproducible-path/fossil-2.25/compat/tcl-8.6/generic -DFOSSIL_HAVE_FUSEFS -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/fossil-2.25=. -fstack-protector-strong -Wformat -Werror=format-security -I/build/reproducible-path/fossil-2.25/compat/tcl-8.6/generic -DHAVE_AUTOCONFIG_H  -c ./extsrc/cson_amalgamation.c -o bld/cson_amalgamation.o

This seems like a bug? (And yes, I understand if the build/host/target are distinct you might want stuff running on the build machine to be built with cc but on the host machine to be built with clang. But here they are the same, and I'm not trying to exert fine-grained control. I'm just trying whack it with a CC/CXX stick.)