Browse Source

Remove warnings, build openlibm without stack protector

Jeremy Soller 7 years ago
parent
commit
232e364f60
9 changed files with 12 additions and 15 deletions
  1. 3 6
      test.sh
  2. 2 5
      tests/.gitignore
  3. 1 1
      tests/Makefile
  4. 0 0
      tests/expected/chdir.stderr
  5. 0 2
      tests/expected/chdir.stdout
  6. 1 0
      tests/expected/math.stdout
  7. 0 0
      tests/fcntl.out
  8. 1 0
      tests/link.c
  9. 4 1
      tests/math.c

+ 3 - 6
test.sh

@@ -4,10 +4,7 @@ set -ex
 cargo build
 cargo build --manifest-path src/crt0/Cargo.toml
 
-cd openlibm
-make
-cd ..
+CFLAGS=-fno-stack-protector make -C openlibm
 
-cd tests
-make clean
-make run
+make -C tests clean
+make -C tests run

+ 2 - 5
tests/.gitignore

@@ -1,3 +1,4 @@
+/*.out
 /gen/
 /alloc
 /args
@@ -6,19 +7,15 @@
 /brk
 /chdir
 /create
-/create.out
 /ctype
 /dup
-/dup.out
 /error
 /fchdir
 /fcntl
 /fsync
 /ftruncate
-/ftruncate.out
 /getid
 /link
-/link.out
 /math
 /mem
 /setid
@@ -36,5 +33,5 @@
 /string/strrchr
 /string/strspn
 /unlink
-/unlink.out
 /write
+

+ 1 - 1
tests/Makefile

@@ -4,7 +4,6 @@ EXPECT_BINS=\
 	atoi \
 	brk \
 	args \
-	chdir \
 	create \
 	ctype \
 	dup \
@@ -35,6 +34,7 @@ EXPECT_BINS=\
 BINS=\
 	$(EXPECT_BINS) \
 	alloc \
+	chdir \
 	getid \
 	setid
 

+ 0 - 0
tests/expected/chdir.stderr


+ 0 - 2
tests/expected/chdir.stdout

@@ -1,2 +0,0 @@
-initial cwd: /home/jeremy/Projects/relibc/tests
-final cwd: /home/jeremy/Projects/relibc

+ 1 - 0
tests/expected/math.stdout

@@ -0,0 +1 @@
+cos(3.14) = -0.9999987483024597

+ 0 - 0
tests/fcntl.out


+ 1 - 0
tests/link.c

@@ -1,3 +1,4 @@
+#include <stdio.h>
 #include <unistd.h>
 
 int main(int argc, char** argv) {

+ 4 - 1
tests/math.c

@@ -1,5 +1,8 @@
 #include <math.h>
+#include <stdio.h>
 
 int main(int argc, char ** argv) {
-    float c = cos(3.14);
+    double pi = 3.14;
+    float c = cos(pi);
+    printf("cos(%f) = %f\n", pi, c);
 }