← cproj

refactor again the tup file, for now create only in this directory the builds and everything else, will use variants later

1e0eed2588c0ef345e0dab11b1addd27dc2bb86a · Ovidiu · Aug 31, 2020 22:28

+20 −477 · 11 files changed

  • .gitignore +3 −0
  • sdstest/Tuprules.tup +11 −25
  • sdstest/build-debug/test/program_debug.txt +0 −231
  • sdstest/build-debug/tup.config +0 −1
  • sdstest/build-release/test/program_release.txt +0 −215
  • sdstest/build-release/tup.config +0 −1
  • sdstest/obj/Tupfile +2 −2
  • sdstest/src/square.c +1 −0
  • sdstest/tup-configs/debug.config +1 −1
  • sdstest/tup-configs/release.config +1 −1
  • sdstest/tup.config +1 −0
diff --git a/.gitignore b/.gitignore
index 950bb44..99841f8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,6 @@
 *.a
 *.o
 **/bin/program*
+**/test/*_release.txt
+**/test/*_debug.txt
+
diff --git a/sdstest/Tuprules.tup b/sdstest/Tuprules.tup
index 2132093..5c3fe1a 100644
--- a/sdstest/Tuprules.tup
+++ b/sdstest/Tuprules.tup
@@ -12,40 +12,26 @@ VALGRND  += --track-origins=yes
 VALGRND  += --verbose
 VALGRND  += --log-file=
 
+
 ifeq (@(BUILD_TYPE),debug)
-# debug build:
   CDEBUG += -Weverything
   CDEBUG += -g
   CDEBUG += -Og
   CDEBUG += -ggdb
-# Do the object files
   !cc = |> clang $(CDEBUG) $(IQT) -c %f -o &(objdir)/%o  |> %B_debug.o
-#  !cc2 = |> clang $(CDEBUG) -v -c %f -o %o  |> %B_debug.o
-# macro for the archive command
+  !cc2 = |> clang $(CDEBUG) -v -c %f -o %o  |> %B_debug.o
   !ar = |> ar crs %o %f |> 
-# Make binaries, debug and release 
   !ccb = |> clang $(CDEBUG) %f -o &(bindir)/%o |> %B
-else
-  ifeq (@(BUILD_TYPE),release)
-  # release build
-  CRELEASE += -O2
-  CRELEASE += -D_FORTIFY_SOURCE=2
-  CRELEASE += -fexceptions
-  CRELEASE += -fvisibility=hidden
-  CRELEASE += -Werror
-  # Create object files - preprocess, compile and assemble steps
-    !cc = |> clang $(CRELEASE) $(IQT) -c %f -o &(objdir)/%o |> %B_release.o
-  # macro for the archive command
-    !ar = |> ar crs %o %f |>
-  # Do binaries, debug and release 
-    !ccb = |> clang $(CRELEASE) %f -o &(bindir)/%o |> %B
   else
-    ifeq (@(BUILD_TYPE),static)
-      : |> echo static |>
-    else
-      error "Build type not set or wrong!"
-    endif
-  endif
+    ifeq(@(BUILD_TYPE),release)
+      CRELEASE += -O2
+      CRELEASE += -D_FORTIFY_SOURCE=2
+      CRELEASE += -fexceptions
+      CRELEASE += -fvisibility=hidden
+      CRELEASE += -Werror
+      !cc = |> clang $(CRELEASE) $(IQT) -c %f -o &(objdir)/%o |> %B_release.o
+      !ar = |> ar crs %o %f |>
+      !ccb = |> clang $(CRELEASE) %f -o &(bindir)/%o |> %B
 endif
 
 # Valgrind the binaries
diff --git a/sdstest/build-debug/test/program_debug.txt b/sdstest/build-debug/test/program_debug.txt
deleted file mode 100644
index 037ec4d..0000000
--- a/sdstest/build-debug/test/program_debug.txt
+++ /dev/null
@@ -1,231 +0,0 @@
-==112876== Memcheck, a memory error detector
-==112876== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
-==112876== Using Valgrind-3.16.1-36d6727e1d-20200622X and LibVEX; rerun with -h for copyright info
-==112876== Command: ../bin/program_debug
-==112876== Parent PID: 112864
-==112876== 
---112876-- 
---112876-- Valgrind options:
---112876--    --leak-check=full
---112876--    --show-leak-kinds=all
---112876--    --track-origins=yes
---112876--    --verbose
---112876--    --log-file=program_debug.txt
---112876-- Contents of /proc/version:
---112876--   Linux version 5.8.5-arch1-1 (linux@archlinux) (gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.35) #1 SMP PREEMPT Thu, 27 Aug 2020 18:53:02 +0000
---112876-- 
---112876-- Arch and hwcaps: AMD64, LittleEndian, amd64-cx16-lzcnt-rdtscp-sse3-ssse3-avx-avx2-bmi-f16c-rdrand
---112876-- Page sizes: currently 4096, max supported 4096
---112876-- Valgrind library directory: /usr/lib/valgrind
---112876-- Reading syms from /home/kiro/proj/cproj/sdstest/build-debug/bin/program_debug
---112876-- Reading syms from /usr/lib/ld-2.32.so
---112876-- Reading syms from /usr/lib/valgrind/memcheck-amd64-linux
---112876--    object doesn't have a dynamic symbol table
---112876-- Scheduler: using generic scheduler lock implementation.
---112876-- Reading suppressions file: /usr/lib/valgrind/default.supp
-==112876== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-112876-by-???-on-???
-==112876== embedded gdbserver: writing to   /tmp/vgdb-pipe-to-vgdb-from-112876-by-???-on-???
-==112876== embedded gdbserver: shared mem   /tmp/vgdb-pipe-shared-mem-vgdb-112876-by-???-on-???
-==112876== 
-==112876== TO CONTROL THIS PROCESS USING vgdb (which you probably
-==112876== don't want to do, unless you know exactly what you're doing,
-==112876== or are doing some strange experiment):
-==112876==   /usr/lib/valgrind/../../bin/vgdb --pid=112876 ...command...
-==112876== 
-==112876== TO DEBUG THIS PROCESS USING GDB: start GDB like this
-==112876==   /path/to/gdb ../bin/program_debug
-==112876== and then give GDB the following command
-==112876==   target remote | /usr/lib/valgrind/../../bin/vgdb --pid=112876
-==112876== --pid is optional if only one valgrind process is running
-==112876== 
---112876-- REDIR: 0x4021ee0 (ld-linux-x86-64.so.2:strlen) redirected to 0x580b9662 (vgPlain_amd64_linux_REDIR_FOR_strlen)
---112876-- REDIR: 0x4021cb0 (ld-linux-x86-64.so.2:index) redirected to 0x580b967c (vgPlain_amd64_linux_REDIR_FOR_index)
---112876-- Reading syms from /usr/lib/valgrind/vgpreload_core-amd64-linux.so
---112876-- Reading syms from /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so
-==112876== WARNING: new redirection conflicts with existing -- ignoring it
---112876--     old: 0x04021ee0 (strlen              ) R-> (0000.0) 0x580b9662 vgPlain_amd64_linux_REDIR_FOR_strlen
---112876--     new: 0x04021ee0 (strlen              ) R-> (2007.0) 0x0483dd90 strlen
---112876-- REDIR: 0x401e6c0 (ld-linux-x86-64.so.2:strcmp) redirected to 0x483ec60 (strcmp)
---112876-- REDIR: 0x4022440 (ld-linux-x86-64.so.2:mempcpy) redirected to 0x4842450 (mempcpy)
---112876-- Reading syms from /usr/lib/libc-2.32.so
---112876-- REDIR: 0x492a8c0 (libc.so.6:memmove) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112876-- REDIR: 0x4929db0 (libc.so.6:strncpy) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112876-- REDIR: 0x492ac00 (libc.so.6:strcasecmp) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112876-- REDIR: 0x4929850 (libc.so.6:strcat) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112876-- REDIR: 0x4929e10 (libc.so.6:rindex) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112876-- REDIR: 0x492bfb0 (libc.so.6:rawmemchr) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112876-- REDIR: 0x4944500 (libc.so.6:wmemchr) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112876-- REDIR: 0x4944040 (libc.so.6:wcscmp) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112876-- REDIR: 0x492aa20 (libc.so.6:mempcpy) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112876-- REDIR: 0x492a850 (libc.so.6:bcmp) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112876-- REDIR: 0x4929d40 (libc.so.6:strncmp) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112876-- REDIR: 0x4929900 (libc.so.6:strcmp) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112876-- REDIR: 0x492a990 (libc.so.6:memset) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112876-- REDIR: 0x4944000 (libc.so.6:wcschr) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112876-- REDIR: 0x4929ca0 (libc.so.6:strnlen) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112876-- REDIR: 0x49299e0 (libc.so.6:strcspn) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112876-- REDIR: 0x492ac50 (libc.so.6:strncasecmp) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112876-- REDIR: 0x4929980 (libc.so.6:strcpy) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112876-- REDIR: 0x492ada0 (libc.so.6:memcpy@@GLIBC_2.14) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112876-- REDIR: 0x4945750 (libc.so.6:wcsnlen) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112876-- REDIR: 0x4944080 (libc.so.6:wcscpy) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112876-- REDIR: 0x4929e50 (libc.so.6:strpbrk) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112876-- REDIR: 0x49298b0 (libc.so.6:index) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112876-- REDIR: 0x4929c60 (libc.so.6:strlen) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112876-- REDIR: 0x49303a0 (libc.so.6:memrchr) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112876-- REDIR: 0x492aca0 (libc.so.6:strcasecmp_l) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112876-- REDIR: 0x492a810 (libc.so.6:memchr) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112876-- REDIR: 0x4944150 (libc.so.6:wcslen) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112876-- REDIR: 0x4929f80 (libc.so.6:strspn) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112876-- REDIR: 0x492aba0 (libc.so.6:stpncpy) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112876-- REDIR: 0x492ab40 (libc.so.6:stpcpy) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112876-- REDIR: 0x492bff0 (libc.so.6:strchrnul) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112876-- REDIR: 0x492acf0 (libc.so.6:strncasecmp_l) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112876-- REDIR: 0x49fc8a0 (libc.so.6:__strrchr_avx2) redirected to 0x483d7d0 (rindex)
---112876-- REDIR: 0x49fca70 (libc.so.6:__strlen_avx2) redirected to 0x483dc70 (strlen)
---112876-- REDIR: 0x4925c90 (libc.so.6:malloc) redirected to 0x483a710 (malloc)
---112876-- REDIR: 0x49ffa80 (libc.so.6:__memcpy_avx_unaligned_erms) redirected to 0x48414b0 (memmove)
---112876-- REDIR: 0x49262f0 (libc.so.6:free) redirected to 0x483b940 (free)
---112876-- REDIR: 0x49fc6b0 (libc.so.6:__strchrnul_avx2) redirected to 0x4841f40 (strchrnul)
---112876-- REDIR: 0x49ffa60 (libc.so.6:__mempcpy_avx_unaligned_erms) redirected to 0x4842050 (mempcpy)
-==112876== Invalid read of size 1
-==112876==    at 0x483DC72: strlen (vg_replace_strmem.c:459)
-==112876==    by 0x4907AB7: __vfprintf_internal (in /usr/lib/libc-2.32.so)
-==112876==    by 0x48F2AE9: fprintf (in /usr/lib/libc-2.32.so)
-==112876==    by 0x1092B7: main (main.c:18)
-==112876==  Address 0x4a66041 is 1 bytes inside a block of size 14 free'd
-==112876==    at 0x483B9AB: free (vg_replace_malloc.c:538)
-==112876==    by 0x10952E: sdsfree (sds.c:167)
-==112876==    by 0x109289: main (main.c:15)
-==112876==  Block was alloc'd at
-==112876==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
-==112876==    by 0x10935B: sdsnewlen (sds.c:99)
-==112876==    by 0x10949F: sdsnew (sds.c:156)
-==112876==    by 0x109276: main (main.c:13)
-==112876== 
-==112876== Invalid read of size 1
-==112876==    at 0x483DC84: strlen (vg_replace_strmem.c:459)
-==112876==    by 0x4907AB7: __vfprintf_internal (in /usr/lib/libc-2.32.so)
-==112876==    by 0x48F2AE9: fprintf (in /usr/lib/libc-2.32.so)
-==112876==    by 0x1092B7: main (main.c:18)
-==112876==  Address 0x4a66042 is 2 bytes inside a block of size 14 free'd
-==112876==    at 0x483B9AB: free (vg_replace_malloc.c:538)
-==112876==    by 0x10952E: sdsfree (sds.c:167)
-==112876==    by 0x109289: main (main.c:15)
-==112876==  Block was alloc'd at
-==112876==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
-==112876==    by 0x10935B: sdsnewlen (sds.c:99)
-==112876==    by 0x10949F: sdsnew (sds.c:156)
-==112876==    by 0x109276: main (main.c:13)
-==112876== 
-==112876== Invalid read of size 1
-==112876==    at 0x48420D0: mempcpy (vg_replace_strmem.c:1536)
-==112876==    by 0x491B8D1: _IO_file_xsputn@@GLIBC_2.2.5 (in /usr/lib/libc-2.32.so)
-==112876==    by 0x490780A: __vfprintf_internal (in /usr/lib/libc-2.32.so)
-==112876==    by 0x48F2AE9: fprintf (in /usr/lib/libc-2.32.so)
-==112876==    by 0x1092B7: main (main.c:18)
-==112876==  Address 0x4a6604c is 12 bytes inside a block of size 14 free'd
-==112876==    at 0x483B9AB: free (vg_replace_malloc.c:538)
-==112876==    by 0x10952E: sdsfree (sds.c:167)
-==112876==    by 0x109289: main (main.c:15)
-==112876==  Block was alloc'd at
-==112876==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
-==112876==    by 0x10935B: sdsnewlen (sds.c:99)
-==112876==    by 0x10949F: sdsnew (sds.c:156)
-==112876==    by 0x109276: main (main.c:13)
-==112876== 
-==112876== Invalid read of size 1
-==112876==    at 0x48420DE: mempcpy (vg_replace_strmem.c:1536)
-==112876==    by 0x491B8D1: _IO_file_xsputn@@GLIBC_2.2.5 (in /usr/lib/libc-2.32.so)
-==112876==    by 0x490780A: __vfprintf_internal (in /usr/lib/libc-2.32.so)
-==112876==    by 0x48F2AE9: fprintf (in /usr/lib/libc-2.32.so)
-==112876==    by 0x1092B7: main (main.c:18)
-==112876==  Address 0x4a6604a is 10 bytes inside a block of size 14 free'd
-==112876==    at 0x483B9AB: free (vg_replace_malloc.c:538)
-==112876==    by 0x10952E: sdsfree (sds.c:167)
-==112876==    by 0x109289: main (main.c:15)
-==112876==  Block was alloc'd at
-==112876==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
-==112876==    by 0x10935B: sdsnewlen (sds.c:99)
-==112876==    by 0x10949F: sdsnew (sds.c:156)
-==112876==    by 0x109276: main (main.c:13)
-==112876== 
-==112876== 
-==112876== HEAP SUMMARY:
-==112876==     in use at exit: 0 bytes in 0 blocks
-==112876==   total heap usage: 2 allocs, 2 frees, 4,110 bytes allocated
-==112876== 
-==112876== All heap blocks were freed -- no leaks are possible
-==112876== 
-==112876== ERROR SUMMARY: 25 errors from 4 contexts (suppressed: 0 from 0)
-==112876== 
-==112876== 1 errors in context 1 of 4:
-==112876== Invalid read of size 1
-==112876==    at 0x483DC72: strlen (vg_replace_strmem.c:459)
-==112876==    by 0x4907AB7: __vfprintf_internal (in /usr/lib/libc-2.32.so)
-==112876==    by 0x48F2AE9: fprintf (in /usr/lib/libc-2.32.so)
-==112876==    by 0x1092B7: main (main.c:18)
-==112876==  Address 0x4a66041 is 1 bytes inside a block of size 14 free'd
-==112876==    at 0x483B9AB: free (vg_replace_malloc.c:538)
-==112876==    by 0x10952E: sdsfree (sds.c:167)
-==112876==    by 0x109289: main (main.c:15)
-==112876==  Block was alloc'd at
-==112876==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
-==112876==    by 0x10935B: sdsnewlen (sds.c:99)
-==112876==    by 0x10949F: sdsnew (sds.c:156)
-==112876==    by 0x109276: main (main.c:13)
-==112876== 
-==112876== 
-==112876== 5 errors in context 2 of 4:
-==112876== Invalid read of size 1
-==112876==    at 0x48420DE: mempcpy (vg_replace_strmem.c:1536)
-==112876==    by 0x491B8D1: _IO_file_xsputn@@GLIBC_2.2.5 (in /usr/lib/libc-2.32.so)
-==112876==    by 0x490780A: __vfprintf_internal (in /usr/lib/libc-2.32.so)
-==112876==    by 0x48F2AE9: fprintf (in /usr/lib/libc-2.32.so)
-==112876==    by 0x1092B7: main (main.c:18)
-==112876==  Address 0x4a6604a is 10 bytes inside a block of size 14 free'd
-==112876==    at 0x483B9AB: free (vg_replace_malloc.c:538)
-==112876==    by 0x10952E: sdsfree (sds.c:167)
-==112876==    by 0x109289: main (main.c:15)
-==112876==  Block was alloc'd at
-==112876==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
-==112876==    by 0x10935B: sdsnewlen (sds.c:99)
-==112876==    by 0x10949F: sdsnew (sds.c:156)
-==112876==    by 0x109276: main (main.c:13)
-==112876== 
-==112876== 
-==112876== 7 errors in context 3 of 4:
-==112876== Invalid read of size 1
-==112876==    at 0x48420D0: mempcpy (vg_replace_strmem.c:1536)
-==112876==    by 0x491B8D1: _IO_file_xsputn@@GLIBC_2.2.5 (in /usr/lib/libc-2.32.so)
-==112876==    by 0x490780A: __vfprintf_internal (in /usr/lib/libc-2.32.so)
-==112876==    by 0x48F2AE9: fprintf (in /usr/lib/libc-2.32.so)
-==112876==    by 0x1092B7: main (main.c:18)
-==112876==  Address 0x4a6604c is 12 bytes inside a block of size 14 free'd
-==112876==    at 0x483B9AB: free (vg_replace_malloc.c:538)
-==112876==    by 0x10952E: sdsfree (sds.c:167)
-==112876==    by 0x109289: main (main.c:15)
-==112876==  Block was alloc'd at
-==112876==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
-==112876==    by 0x10935B: sdsnewlen (sds.c:99)
-==112876==    by 0x10949F: sdsnew (sds.c:156)
-==112876==    by 0x109276: main (main.c:13)
-==112876== 
-==112876== 
-==112876== 12 errors in context 4 of 4:
-==112876== Invalid read of size 1
-==112876==    at 0x483DC84: strlen (vg_replace_strmem.c:459)
-==112876==    by 0x4907AB7: __vfprintf_internal (in /usr/lib/libc-2.32.so)
-==112876==    by 0x48F2AE9: fprintf (in /usr/lib/libc-2.32.so)
-==112876==    by 0x1092B7: main (main.c:18)
-==112876==  Address 0x4a66042 is 2 bytes inside a block of size 14 free'd
-==112876==    at 0x483B9AB: free (vg_replace_malloc.c:538)
-==112876==    by 0x10952E: sdsfree (sds.c:167)
-==112876==    by 0x109289: main (main.c:15)
-==112876==  Block was alloc'd at
-==112876==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
-==112876==    by 0x10935B: sdsnewlen (sds.c:99)
-==112876==    by 0x10949F: sdsnew (sds.c:156)
-==112876==    by 0x109276: main (main.c:13)
-==112876== 
-==112876== ERROR SUMMARY: 25 errors from 4 contexts (suppressed: 0 from 0)
diff --git a/sdstest/build-debug/tup.config b/sdstest/build-debug/tup.config
deleted file mode 120000
index 84c56af..0000000
--- a/sdstest/build-debug/tup.config
+++ /dev/null
@@ -1 +0,0 @@
-../tup-configs/debug.config
\ No newline at end of file
diff --git a/sdstest/build-release/test/program_release.txt b/sdstest/build-release/test/program_release.txt
deleted file mode 100644
index 8ee8089..0000000
--- a/sdstest/build-release/test/program_release.txt
+++ /dev/null
@@ -1,215 +0,0 @@
-==112998== Memcheck, a memory error detector
-==112998== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
-==112998== Using Valgrind-3.16.1-36d6727e1d-20200622X and LibVEX; rerun with -h for copyright info
-==112998== Command: ../bin/program_release
-==112998== Parent PID: 112987
-==112998== 
---112998-- 
---112998-- Valgrind options:
---112998--    --leak-check=full
---112998--    --show-leak-kinds=all
---112998--    --track-origins=yes
---112998--    --verbose
---112998--    --log-file=program_release.txt
---112998-- Contents of /proc/version:
---112998--   Linux version 5.8.5-arch1-1 (linux@archlinux) (gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.35) #1 SMP PREEMPT Thu, 27 Aug 2020 18:53:02 +0000
---112998-- 
---112998-- Arch and hwcaps: AMD64, LittleEndian, amd64-cx16-lzcnt-rdtscp-sse3-ssse3-avx-avx2-bmi-f16c-rdrand
---112998-- Page sizes: currently 4096, max supported 4096
---112998-- Valgrind library directory: /usr/lib/valgrind
---112998-- Reading syms from /home/kiro/proj/cproj/sdstest/build-release/bin/program_release
---112998-- Reading syms from /usr/lib/ld-2.32.so
---112998-- Reading syms from /usr/lib/valgrind/memcheck-amd64-linux
---112998--    object doesn't have a dynamic symbol table
---112998-- Scheduler: using generic scheduler lock implementation.
---112998-- Reading suppressions file: /usr/lib/valgrind/default.supp
-==112998== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-112998-by-???-on-???
-==112998== embedded gdbserver: writing to   /tmp/vgdb-pipe-to-vgdb-from-112998-by-???-on-???
-==112998== embedded gdbserver: shared mem   /tmp/vgdb-pipe-shared-mem-vgdb-112998-by-???-on-???
-==112998== 
-==112998== TO CONTROL THIS PROCESS USING vgdb (which you probably
-==112998== don't want to do, unless you know exactly what you're doing,
-==112998== or are doing some strange experiment):
-==112998==   /usr/lib/valgrind/../../bin/vgdb --pid=112998 ...command...
-==112998== 
-==112998== TO DEBUG THIS PROCESS USING GDB: start GDB like this
-==112998==   /path/to/gdb ../bin/program_release
-==112998== and then give GDB the following command
-==112998==   target remote | /usr/lib/valgrind/../../bin/vgdb --pid=112998
-==112998== --pid is optional if only one valgrind process is running
-==112998== 
---112998-- REDIR: 0x4021ee0 (ld-linux-x86-64.so.2:strlen) redirected to 0x580b9662 (vgPlain_amd64_linux_REDIR_FOR_strlen)
---112998-- REDIR: 0x4021cb0 (ld-linux-x86-64.so.2:index) redirected to 0x580b967c (vgPlain_amd64_linux_REDIR_FOR_index)
---112998-- Reading syms from /usr/lib/valgrind/vgpreload_core-amd64-linux.so
---112998-- Reading syms from /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so
-==112998== WARNING: new redirection conflicts with existing -- ignoring it
---112998--     old: 0x04021ee0 (strlen              ) R-> (0000.0) 0x580b9662 vgPlain_amd64_linux_REDIR_FOR_strlen
---112998--     new: 0x04021ee0 (strlen              ) R-> (2007.0) 0x0483dd90 strlen
---112998-- REDIR: 0x401e6c0 (ld-linux-x86-64.so.2:strcmp) redirected to 0x483ec60 (strcmp)
---112998-- REDIR: 0x4022440 (ld-linux-x86-64.so.2:mempcpy) redirected to 0x4842450 (mempcpy)
---112998-- Reading syms from /usr/lib/libc-2.32.so
---112998-- REDIR: 0x492a8c0 (libc.so.6:memmove) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112998-- REDIR: 0x4929db0 (libc.so.6:strncpy) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112998-- REDIR: 0x492ac00 (libc.so.6:strcasecmp) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112998-- REDIR: 0x4929850 (libc.so.6:strcat) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112998-- REDIR: 0x4929e10 (libc.so.6:rindex) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112998-- REDIR: 0x492bfb0 (libc.so.6:rawmemchr) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112998-- REDIR: 0x4944500 (libc.so.6:wmemchr) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112998-- REDIR: 0x4944040 (libc.so.6:wcscmp) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112998-- REDIR: 0x492aa20 (libc.so.6:mempcpy) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112998-- REDIR: 0x492a850 (libc.so.6:bcmp) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112998-- REDIR: 0x4929d40 (libc.so.6:strncmp) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112998-- REDIR: 0x4929900 (libc.so.6:strcmp) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112998-- REDIR: 0x492a990 (libc.so.6:memset) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112998-- REDIR: 0x4944000 (libc.so.6:wcschr) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112998-- REDIR: 0x4929ca0 (libc.so.6:strnlen) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112998-- REDIR: 0x49299e0 (libc.so.6:strcspn) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112998-- REDIR: 0x492ac50 (libc.so.6:strncasecmp) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112998-- REDIR: 0x4929980 (libc.so.6:strcpy) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112998-- REDIR: 0x492ada0 (libc.so.6:memcpy@@GLIBC_2.14) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112998-- REDIR: 0x4945750 (libc.so.6:wcsnlen) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112998-- REDIR: 0x4944080 (libc.so.6:wcscpy) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112998-- REDIR: 0x4929e50 (libc.so.6:strpbrk) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112998-- REDIR: 0x49298b0 (libc.so.6:index) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112998-- REDIR: 0x4929c60 (libc.so.6:strlen) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112998-- REDIR: 0x49303a0 (libc.so.6:memrchr) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112998-- REDIR: 0x492aca0 (libc.so.6:strcasecmp_l) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112998-- REDIR: 0x492a810 (libc.so.6:memchr) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112998-- REDIR: 0x4944150 (libc.so.6:wcslen) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112998-- REDIR: 0x4929f80 (libc.so.6:strspn) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112998-- REDIR: 0x492aba0 (libc.so.6:stpncpy) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112998-- REDIR: 0x492ab40 (libc.so.6:stpcpy) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112998-- REDIR: 0x492bff0 (libc.so.6:strchrnul) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112998-- REDIR: 0x492acf0 (libc.so.6:strncasecmp_l) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---112998-- REDIR: 0x49fc8a0 (libc.so.6:__strrchr_avx2) redirected to 0x483d7d0 (rindex)
---112998-- REDIR: 0x49fc6b0 (libc.so.6:__strchrnul_avx2) redirected to 0x4841f40 (strchrnul)
---112998-- REDIR: 0x49ffa60 (libc.so.6:__mempcpy_avx_unaligned_erms) redirected to 0x4842050 (mempcpy)
---112998-- REDIR: 0x49fca70 (libc.so.6:__strlen_avx2) redirected to 0x483dc70 (strlen)
---112998-- REDIR: 0x4925c90 (libc.so.6:malloc) redirected to 0x483a710 (malloc)
---112998-- REDIR: 0x49ffa80 (libc.so.6:__memcpy_avx_unaligned_erms) redirected to 0x48414b0 (memmove)
---112998-- REDIR: 0x49262f0 (libc.so.6:free) redirected to 0x483b940 (free)
-==112998== Invalid read of size 1
-==112998==    at 0x483DC72: strlen (vg_replace_strmem.c:459)
-==112998==    by 0x4907AB7: __vfprintf_internal (in /usr/lib/libc-2.32.so)
-==112998==    by 0x49A80A2: __fprintf_chk (in /usr/lib/libc-2.32.so)
-==112998==    by 0x1092DC: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
-==112998==  Address 0x4a66041 is 1 bytes inside a block of size 14 free'd
-==112998==    at 0x483B9AB: free (vg_replace_malloc.c:538)
-==112998==    by 0x1092A4: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
-==112998==  Block was alloc'd at
-==112998==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
-==112998==    by 0x109381: sdsnewlen (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
-==112998==    by 0x109283: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
-==112998== 
-==112998== Invalid read of size 1
-==112998==    at 0x483DC84: strlen (vg_replace_strmem.c:459)
-==112998==    by 0x4907AB7: __vfprintf_internal (in /usr/lib/libc-2.32.so)
-==112998==    by 0x49A80A2: __fprintf_chk (in /usr/lib/libc-2.32.so)
-==112998==    by 0x1092DC: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
-==112998==  Address 0x4a66042 is 2 bytes inside a block of size 14 free'd
-==112998==    at 0x483B9AB: free (vg_replace_malloc.c:538)
-==112998==    by 0x1092A4: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
-==112998==  Block was alloc'd at
-==112998==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
-==112998==    by 0x109381: sdsnewlen (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
-==112998==    by 0x109283: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
-==112998== 
-==112998== Invalid read of size 1
-==112998==    at 0x48420D0: mempcpy (vg_replace_strmem.c:1536)
-==112998==    by 0x491B8D1: _IO_file_xsputn@@GLIBC_2.2.5 (in /usr/lib/libc-2.32.so)
-==112998==    by 0x490780A: __vfprintf_internal (in /usr/lib/libc-2.32.so)
-==112998==    by 0x49A80A2: __fprintf_chk (in /usr/lib/libc-2.32.so)
-==112998==    by 0x1092DC: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
-==112998==  Address 0x4a6604c is 12 bytes inside a block of size 14 free'd
-==112998==    at 0x483B9AB: free (vg_replace_malloc.c:538)
-==112998==    by 0x1092A4: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
-==112998==  Block was alloc'd at
-==112998==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
-==112998==    by 0x109381: sdsnewlen (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
-==112998==    by 0x109283: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
-==112998== 
-==112998== Invalid read of size 1
-==112998==    at 0x48420DE: mempcpy (vg_replace_strmem.c:1536)
-==112998==    by 0x491B8D1: _IO_file_xsputn@@GLIBC_2.2.5 (in /usr/lib/libc-2.32.so)
-==112998==    by 0x490780A: __vfprintf_internal (in /usr/lib/libc-2.32.so)
-==112998==    by 0x49A80A2: __fprintf_chk (in /usr/lib/libc-2.32.so)
-==112998==    by 0x1092DC: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
-==112998==  Address 0x4a6604a is 10 bytes inside a block of size 14 free'd
-==112998==    at 0x483B9AB: free (vg_replace_malloc.c:538)
-==112998==    by 0x1092A4: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
-==112998==  Block was alloc'd at
-==112998==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
-==112998==    by 0x109381: sdsnewlen (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
-==112998==    by 0x109283: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
-==112998== 
-==112998== 
-==112998== HEAP SUMMARY:
-==112998==     in use at exit: 0 bytes in 0 blocks
-==112998==   total heap usage: 2 allocs, 2 frees, 4,110 bytes allocated
-==112998== 
-==112998== All heap blocks were freed -- no leaks are possible
-==112998== 
-==112998== ERROR SUMMARY: 25 errors from 4 contexts (suppressed: 0 from 0)
-==112998== 
-==112998== 1 errors in context 1 of 4:
-==112998== Invalid read of size 1
-==112998==    at 0x483DC72: strlen (vg_replace_strmem.c:459)
-==112998==    by 0x4907AB7: __vfprintf_internal (in /usr/lib/libc-2.32.so)
-==112998==    by 0x49A80A2: __fprintf_chk (in /usr/lib/libc-2.32.so)
-==112998==    by 0x1092DC: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
-==112998==  Address 0x4a66041 is 1 bytes inside a block of size 14 free'd
-==112998==    at 0x483B9AB: free (vg_replace_malloc.c:538)
-==112998==    by 0x1092A4: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
-==112998==  Block was alloc'd at
-==112998==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
-==112998==    by 0x109381: sdsnewlen (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
-==112998==    by 0x109283: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
-==112998== 
-==112998== 
-==112998== 5 errors in context 2 of 4:
-==112998== Invalid read of size 1
-==112998==    at 0x48420DE: mempcpy (vg_replace_strmem.c:1536)
-==112998==    by 0x491B8D1: _IO_file_xsputn@@GLIBC_2.2.5 (in /usr/lib/libc-2.32.so)
-==112998==    by 0x490780A: __vfprintf_internal (in /usr/lib/libc-2.32.so)
-==112998==    by 0x49A80A2: __fprintf_chk (in /usr/lib/libc-2.32.so)
-==112998==    by 0x1092DC: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
-==112998==  Address 0x4a6604a is 10 bytes inside a block of size 14 free'd
-==112998==    at 0x483B9AB: free (vg_replace_malloc.c:538)
-==112998==    by 0x1092A4: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
-==112998==  Block was alloc'd at
-==112998==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
-==112998==    by 0x109381: sdsnewlen (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
-==112998==    by 0x109283: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
-==112998== 
-==112998== 
-==112998== 7 errors in context 3 of 4:
-==112998== Invalid read of size 1
-==112998==    at 0x48420D0: mempcpy (vg_replace_strmem.c:1536)
-==112998==    by 0x491B8D1: _IO_file_xsputn@@GLIBC_2.2.5 (in /usr/lib/libc-2.32.so)
-==112998==    by 0x490780A: __vfprintf_internal (in /usr/lib/libc-2.32.so)
-==112998==    by 0x49A80A2: __fprintf_chk (in /usr/lib/libc-2.32.so)
-==112998==    by 0x1092DC: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
-==112998==  Address 0x4a6604c is 12 bytes inside a block of size 14 free'd
-==112998==    at 0x483B9AB: free (vg_replace_malloc.c:538)
-==112998==    by 0x1092A4: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
-==112998==  Block was alloc'd at
-==112998==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
-==112998==    by 0x109381: sdsnewlen (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
-==112998==    by 0x109283: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
-==112998== 
-==112998== 
-==112998== 12 errors in context 4 of 4:
-==112998== Invalid read of size 1
-==112998==    at 0x483DC84: strlen (vg_replace_strmem.c:459)
-==112998==    by 0x4907AB7: __vfprintf_internal (in /usr/lib/libc-2.32.so)
-==112998==    by 0x49A80A2: __fprintf_chk (in /usr/lib/libc-2.32.so)
-==112998==    by 0x1092DC: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
-==112998==  Address 0x4a66042 is 2 bytes inside a block of size 14 free'd
-==112998==    at 0x483B9AB: free (vg_replace_malloc.c:538)
-==112998==    by 0x1092A4: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
-==112998==  Block was alloc'd at
-==112998==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
-==112998==    by 0x109381: sdsnewlen (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
-==112998==    by 0x109283: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
-==112998== 
-==112998== ERROR SUMMARY: 25 errors from 4 contexts (suppressed: 0 from 0)
diff --git a/sdstest/build-release/tup.config b/sdstest/build-release/tup.config
deleted file mode 120000
index 98b9f34..0000000
--- a/sdstest/build-release/tup.config
+++ /dev/null
@@ -1 +0,0 @@
-../tup-configs/release.config
\ No newline at end of file
diff --git a/sdstest/obj/Tupfile b/sdstest/obj/Tupfile
index b20e203..739c478 100644
--- a/sdstest/obj/Tupfile
+++ b/sdstest/obj/Tupfile
@@ -5,9 +5,9 @@
 
 include_rules
 
-
-ifeq (@(DO_RELEASE),y)
+ifeq (@(BUILD_TYPE),debug)
 : foreach ../src/*.c |> !cc |>
+: foreach ../lib/sds/*.c |> !cc |> 
 else
 : foreach ../src/*.c |> !cc |>
 : foreach ../lib/sds/*.c |> !cc |> 
diff --git a/sdstest/src/square.c b/sdstest/src/square.c
index 09d77fa..27cb2ce 100644
--- a/sdstest/src/square.c
+++ b/sdstest/src/square.c
@@ -1,5 +1,6 @@
 #include "../include/square.h"
 
+
 extern int square(int x, int y) {
 
   fprintf(stdout, "Square of %d and %d is: %d\n",x,y,x*y );
diff --git a/sdstest/tup-configs/debug.config b/sdstest/tup-configs/debug.config
index 3ac8c3d..c6652af 100644
--- a/sdstest/tup-configs/debug.config
+++ b/sdstest/tup-configs/debug.config
@@ -1 +1 @@
-CONFIG_BUILD_TYPE=debug
+DISCONFIG_BUILD_TYPE=debug
diff --git a/sdstest/tup-configs/release.config b/sdstest/tup-configs/release.config
index ef47cea..f4fe452 100644
--- a/sdstest/tup-configs/release.config
+++ b/sdstest/tup-configs/release.config
@@ -1 +1 @@
-CONFIG_BUILD_TYPE=release
+DISCONFIG_BUILD_TYPE=release
diff --git a/sdstest/tup.config b/sdstest/tup.config
new file mode 100644
index 0000000..3ac8c3d
--- /dev/null
+++ b/sdstest/tup.config
@@ -0,0 +1 @@
+CONFIG_BUILD_TYPE=debug