Skip to content

Commit

Permalink
Fix debug build's predefined-macros.txt (#407)
Browse files Browse the repository at this point in the history
This commit fixes the ability to build `wasi-libc` with `-g` options and
possibly without `-O2` options as well. I've found this useful when
debugging issues as historically that the build fails when `-g` is
passed or optimizations are removed due to the checks against these
expectation files. This commit adds more filters to the list of macros
to ensure that optimization/debug related ones are all removed from the
expectation lists.
  • Loading branch information
alexcrichton committed Apr 5, 2023
1 parent 1dfe5c3 commit 38f4894
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,10 @@ check-symbols: startup_files libc
| sed -e 's/__GNUC_VA_LIST $$/__GNUC_VA_LIST 1/' \
| grep -v '^#define __\(BOOL\|INT_\(LEAST\|FAST\)\(8\|16\|32\|64\)\|INT\|LONG\|LLONG\|SHRT\)_WIDTH__' \
| grep -v '^#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_\(1\|2\|4\|8\)' \
| grep -v '^#define NDEBUG' \
| grep -v '^#define __OPTIMIZE__' \
| grep -v '^#define assert' \
| grep -v '^#define __NO_INLINE__' \
> "$(SYSROOT_SHARE)/predefined-macros.txt"

# Check that the computed metadata matches the expected metadata.
Expand Down
3 changes: 0 additions & 3 deletions expected/wasm32-wasi-threads/predefined-macros.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,6 @@
#define NAN (0.0f/0.0f)
#define NBBY 8
#define NCARGS 131072
#define NDEBUG 1
#define ND_NA_FLAG_OVERRIDE 0x00000020
#define ND_NA_FLAG_ROUTER 0x00000080
#define ND_NA_FLAG_SOLICITED 0x00000040
Expand Down Expand Up @@ -2685,7 +2684,6 @@
#define __OPENCL_MEMORY_SCOPE_SUB_GROUP 4
#define __OPENCL_MEMORY_SCOPE_WORK_GROUP 1
#define __OPENCL_MEMORY_SCOPE_WORK_ITEM 0
#define __OPTIMIZE__ 1
#define __ORDER_BIG_ENDIAN__ 4321
#define __ORDER_LITTLE_ENDIAN__ 1234
#define __ORDER_PDP_ENDIAN__ 3412
Expand Down Expand Up @@ -3112,7 +3110,6 @@
#define and_eq &=
#define asin(x) __tg_real_complex(asin, (x))
#define asinh(x) __tg_real_complex(asinh, (x))
#define assert(x) (void)0
#define atan(x) __tg_real_complex(atan, (x))
#define atan2(x,y) __tg_real_2(atan2, (x), (y))
#define atanh(x) __tg_real_complex(atanh, (x))
Expand Down
3 changes: 0 additions & 3 deletions expected/wasm32-wasi/predefined-macros.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,6 @@
#define NAN (0.0f/0.0f)
#define NBBY 8
#define NCARGS 131072
#define NDEBUG 1
#define ND_NA_FLAG_OVERRIDE 0x00000020
#define ND_NA_FLAG_ROUTER 0x00000080
#define ND_NA_FLAG_SOLICITED 0x00000040
Expand Down Expand Up @@ -2648,7 +2647,6 @@
#define __OPENCL_MEMORY_SCOPE_SUB_GROUP 4
#define __OPENCL_MEMORY_SCOPE_WORK_GROUP 1
#define __OPENCL_MEMORY_SCOPE_WORK_ITEM 0
#define __OPTIMIZE__ 1
#define __ORDER_BIG_ENDIAN__ 4321
#define __ORDER_LITTLE_ENDIAN__ 1234
#define __ORDER_PDP_ENDIAN__ 3412
Expand Down Expand Up @@ -3073,7 +3071,6 @@
#define and_eq &=
#define asin(x) __tg_real_complex(asin, (x))
#define asinh(x) __tg_real_complex(asinh, (x))
#define assert(x) (void)0
#define atan(x) __tg_real_complex(atan, (x))
#define atan2(x,y) __tg_real_2(atan2, (x), (y))
#define atanh(x) __tg_real_complex(atanh, (x))
Expand Down

0 comments on commit 38f4894

Please sign in to comment.