diff --git a/makefile b/makefile index c20aa444..09573b62 100644 --- a/makefile +++ b/makefile @@ -22,14 +22,16 @@ c: # custom b: gen +PIE = -no-pie + single-o3: - $(CC) -std=gnu11 -Wall -Wno-unused-function -fms-extensions $(CCFLAGS) -no-pie $(f) -O3 -o BQN src/opt/single.c -lm + $(CC) -std=gnu11 -Wall -Wno-unused-function -fms-extensions $(CCFLAGS) ${PIE} $(f) -O3 -o BQN src/opt/single.c -lm single-o3g: - $(CC) -std=gnu11 -Wall -Wno-unused-function -fms-extensions $(CCFLAGS) -no-pie $(f) -O3 -g -o BQN src/opt/single.c -lm + $(CC) -std=gnu11 -Wall -Wno-unused-function -fms-extensions $(CCFLAGS) ${PIE} $(f) -O3 -g -o BQN src/opt/single.c -lm single-debug: - $(CC) -std=gnu11 -Wall -Wno-unused-function -fms-extensions $(CCFLAGS) -no-pie $(f) -DDEBUG -g -o BQN src/opt/single.c -lm + $(CC) -std=gnu11 -Wall -Wno-unused-function -fms-extensions $(CCFLAGS) ${PIE} $(f) -DDEBUG -g -o BQN src/opt/single.c -lm single-c: - $(CC) -std=gnu11 -Wall -Wno-unused-function -fms-extensions $(CCFLAGS) -no-pie $(f) -o BQN src/opt/single.c -lm + $(CC) -std=gnu11 -Wall -Wno-unused-function -fms-extensions $(CCFLAGS) ${PIE} $(f) -o BQN src/opt/single.c -lm # compiler setup @@ -74,7 +76,7 @@ bd = obj/${t} gen: builtins core base jit utils # build the final binary - @$(CC) -no-pie -o BQN ${bd}/*.o -lm + @$(CC) ${PIE} -o BQN ${bd}/*.o -lm @echo builddir: # create the build directory. makefiles are stupid diff --git a/src/builtins/sysfn.c b/src/builtins/sysfn.c index 82bef4cd..b9c5cc9c 100644 --- a/src/builtins/sysfn.c +++ b/src/builtins/sysfn.c @@ -1,4 +1,3 @@ -#include #include #include #include @@ -608,6 +607,8 @@ B fromUtf8_c1(B t, B x) { extern char** environ; +#if __has_include() +#include B sh_c1(B t, B x) { if (isAtm(x) || rnk(x)>1) thrM("•SH: 𝕩 must be a vector of strings"); usz xia = a(x)->ia; @@ -659,6 +660,11 @@ B sh_c1(B t, B x) { dec(x); return m_v3(m_i32(WEXITSTATUS(status)), s_out, s_err); } +#else +B sh_c1(B t, B x) { + thrM("•SH: CBQN was built without "); +} +#endif B getInternalNS(void);