Create a toolenv for newfs

This commit is contained in:
Ali Mashtizadeh 2023-09-10 21:03:01 -04:00
parent 344c104ceb
commit fe1f411bdc
2 changed files with 7 additions and 1 deletions

View File

@ -48,6 +48,8 @@ if 'CPPFLAGS' in os.environ:
if 'LDFLAGS' in os.environ:
env.Append(LINKFLAGS = SCons.Util.CLVar(os.environ['LDFLAGS']))
toolenv = env.Clone()
env.Append(CFLAGS = [ "-Wshadow", "-Wno-typedef-redefinition" ])
env.Append(CPPFLAGS = [ "-target", "x86_64-freebsd-freebsd-elf",
"-fno-builtin", "-fno-stack-protector",
@ -151,6 +153,7 @@ if not env["CCVERSION"].startswith("15."):
conf.Finish()
Export('env')
Export('toolenv')
# Program start/end

View File

@ -1,14 +1,17 @@
import sys
Import('toolenv')
Import('env')
newfs_env = env.Clone()
if (env["TOOLCHAINBUILD"] == "TRUE"):
newfs_env = toolenv.Clone()
src = [
"newfs_o2fs.c"
]
if newfs_env["TOOLCHAINBUILD"] != "TRUE":
if env["TOOLCHAINBUILD"] != "TRUE":
newfs_env.Append(LINKFLAGS = ['-nostdlib'])
newfs_env.Append(CPPFLAGS = ['-nostdinc'])
newfs_env.Append(LIBPATH = ['#build/lib/libc'], LIBS = ['c'])