libk  Check-in [49bf71fb47]

Overview
Comment:enable debugging and add -ffreestanding to gcc cmd line to squash attempts to "optimize" functions by converting them to libc calls, e.g. turning kmzero() calls into memset() calls
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 49bf71fb47fe3eb8735a26becb29a36ead58f21cbfe776b4c043fd9b654f2f06
User & Date: lexi on 2019-08-21 01:58:02
Other Links: manifest | tags
Context
2019-08-21
03:10
add assembly output flag to build.sh check-in: 06e32bd3b4 user: lexi tags: trunk
01:58
enable debugging and add -ffreestanding to gcc cmd line to squash attempts to "optimize" functions by converting them to libc calls, e.g. turning kmzero() calls into memset() calls check-in: 49bf71fb47 user: lexi tags: trunk
01:20
rename $out build var to $to for nixos compat; refactor announce command to choose a color automatically instead of forcing it to be specified on every command line check-in: b590aba21d user: lexi tags: trunk
Changes

Modified build.sh from [b2a27b403b] to [3df2029917].

114
115
116
117
118
119
120



121
122
123
124
125
126
127
128
129
...
132
133
134
135
136
137
138



139
140
141
142
143
144
145
146
147
148
149
150
151





152
153
154
155
156
157
158
159
	local output=$2
	local flags=$3
	if test -e "$output"; then
		if test ! "$output" -ot "$src"; then
			return
		fi 
	fi



	          $m4 $macro_compile_env -I "$gen" $flags "$src"  > "$output"
	announce  $m4 $macro_compile_env -I "$gen" $flags "$src" \> "$output"
	# yes, this is incredibly stupid. if you know a better way, feel
	# free to submit a fix. the problem is there's no way to pass >
	# to report in such a way that it'll do the right thing, and if
	# you just write > it redirects *report's* output, instead of
	# m4's. piece of shit that it is, m4 doesn't have any way to emit
	# output into a fille - stdout only apparently. tl;dr i hate bash.
}
................................................................................
	local output=$2
	local flags=$3
	if test -e "$output"; then
		if test ! "$output" -ot "$src"; then
			return
		fi
	fi



	report $asm $flags "-f$bin_fmt" -i "$gen" "$src" -o "$output";
}
comp_co()  { comp_c $1 $2 "-c -fPIC"; }
comp_c(){
	local src=$1
	local output=$2
	local flags=$3
	if test -e "$output"; then
		if test ! "$output" -ot "$src"; then
			return
		fi
	fi
	# only rebuild the file if the source file is newer





	report $cc $src $3 -std=c11 -isystem "$to" -isystem "$gen" -isystem "arch/" -nostdlib "-L$to" "-o$output"
}

say "commencing libk build $build at $(timestamp)"
# set -x

# get type data
mkdir -p $gen







>
>
>
|
|







 







>
>
>
|












>
>
>
>
>
|







114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
...
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
	local output=$2
	local flags=$3
	if test -e "$output"; then
		if test ! "$output" -ot "$src"; then
			return
		fi 
	fi
	if test "$debug" = yes; then
		local dflag=-Dcompile_debug=yes
	fi
	         $m4 $macro_compile_env $dflag -I "$gen" $flags "$src"  > "$output"
	announce $m4 $macro_compile_env $dflag -I "$gen" $flags "$src" \> "$output"
	# yes, this is incredibly stupid. if you know a better way, feel
	# free to submit a fix. the problem is there's no way to pass >
	# to report in such a way that it'll do the right thing, and if
	# you just write > it redirects *report's* output, instead of
	# m4's. piece of shit that it is, m4 doesn't have any way to emit
	# output into a fille - stdout only apparently. tl;dr i hate bash.
}
................................................................................
	local output=$2
	local flags=$3
	if test -e "$output"; then
		if test ! "$output" -ot "$src"; then
			return
		fi
	fi
	if test "$debug" = yes; then
		local dflag="-g dwarf2"
	fi
	report $asm $flags $dflag "-f$bin_fmt" -i "$gen" "$src" -o "$output";
}
comp_co()  { comp_c $1 $2 "-c -fPIC"; }
comp_c(){
	local src=$1
	local output=$2
	local flags=$3
	if test -e "$output"; then
		if test ! "$output" -ot "$src"; then
			return
		fi
	fi
	# only rebuild the file if the source file is newer
	if test "$debug" = yes; then
		local dflag="-g"
	else
		local dflag="-O4"
	fi
	report $cc $src $3 $dflag -std=c11 -isystem "$to" -isystem "$gen" -isystem "arch/" -ffreestanding -nostdlib "-L$to" "-o$output"
}

say "commencing libk build $build at $(timestamp)"
# set -x

# get type data
mkdir -p $gen