Skip to content

Commit 38f4894

Browse files
authored
Fix debug build's predefined-macros.txt (#407)
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.
1 parent 1dfe5c3 commit 38f4894

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,10 @@ check-symbols: startup_files libc
702702
| sed -e 's/__GNUC_VA_LIST $$/__GNUC_VA_LIST 1/' \
703703
| grep -v '^#define __\(BOOL\|INT_\(LEAST\|FAST\)\(8\|16\|32\|64\)\|INT\|LONG\|LLONG\|SHRT\)_WIDTH__' \
704704
| grep -v '^#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_\(1\|2\|4\|8\)' \
705+
| grep -v '^#define NDEBUG' \
706+
| grep -v '^#define __OPTIMIZE__' \
707+
| grep -v '^#define assert' \
708+
| grep -v '^#define __NO_INLINE__' \
705709
> "$(SYSROOT_SHARE)/predefined-macros.txt"
706710

707711
# Check that the computed metadata matches the expected metadata.

expected/wasm32-wasi-threads/predefined-macros.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,6 @@
11191119
#define NAN (0.0f/0.0f)
11201120
#define NBBY 8
11211121
#define NCARGS 131072
1122-
#define NDEBUG 1
11231122
#define ND_NA_FLAG_OVERRIDE 0x00000020
11241123
#define ND_NA_FLAG_ROUTER 0x00000080
11251124
#define ND_NA_FLAG_SOLICITED 0x00000040
@@ -2685,7 +2684,6 @@
26852684
#define __OPENCL_MEMORY_SCOPE_SUB_GROUP 4
26862685
#define __OPENCL_MEMORY_SCOPE_WORK_GROUP 1
26872686
#define __OPENCL_MEMORY_SCOPE_WORK_ITEM 0
2688-
#define __OPTIMIZE__ 1
26892687
#define __ORDER_BIG_ENDIAN__ 4321
26902688
#define __ORDER_LITTLE_ENDIAN__ 1234
26912689
#define __ORDER_PDP_ENDIAN__ 3412
@@ -3112,7 +3110,6 @@
31123110
#define and_eq &=
31133111
#define asin(x) __tg_real_complex(asin, (x))
31143112
#define asinh(x) __tg_real_complex(asinh, (x))
3115-
#define assert(x) (void)0
31163113
#define atan(x) __tg_real_complex(atan, (x))
31173114
#define atan2(x,y) __tg_real_2(atan2, (x), (y))
31183115
#define atanh(x) __tg_real_complex(atanh, (x))

expected/wasm32-wasi/predefined-macros.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,6 @@
11191119
#define NAN (0.0f/0.0f)
11201120
#define NBBY 8
11211121
#define NCARGS 131072
1122-
#define NDEBUG 1
11231122
#define ND_NA_FLAG_OVERRIDE 0x00000020
11241123
#define ND_NA_FLAG_ROUTER 0x00000080
11251124
#define ND_NA_FLAG_SOLICITED 0x00000040
@@ -2648,7 +2647,6 @@
26482647
#define __OPENCL_MEMORY_SCOPE_SUB_GROUP 4
26492648
#define __OPENCL_MEMORY_SCOPE_WORK_GROUP 1
26502649
#define __OPENCL_MEMORY_SCOPE_WORK_ITEM 0
2651-
#define __OPTIMIZE__ 1
26522650
#define __ORDER_BIG_ENDIAN__ 4321
26532651
#define __ORDER_LITTLE_ENDIAN__ 1234
26542652
#define __ORDER_PDP_ENDIAN__ 3412
@@ -3073,7 +3071,6 @@
30733071
#define and_eq &=
30743072
#define asin(x) __tg_real_complex(asin, (x))
30753073
#define asinh(x) __tg_real_complex(asinh, (x))
3076-
#define assert(x) (void)0
30773074
#define atan(x) __tg_real_complex(atan, (x))
30783075
#define atan2(x,y) __tg_real_2(atan2, (x), (y))
30793076
#define atanh(x) __tg_real_complex(atanh, (x))

0 commit comments

Comments
 (0)