Skip to content

Makefile: use -MMD flag for automatic object file dependency generation - #366

Open
rdevshp wants to merge 1 commit into
GrapheneOS:mainfrom
rdevshp:auto_dep_tracking
Open

Makefile: use -MMD flag for automatic object file dependency generation#366
rdevshp wants to merge 1 commit into
GrapheneOS:mainfrom
rdevshp:auto_dep_tracking

Conversation

@rdevshp

@rdevshp rdevshp commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

The Makefile header dependencies for h_malloc.o is missing third_party/libdivide.h and memtag.h.

This PR switches the Makefile to use dependency files generated by the compiler instead.

@rdevshp
rdevshp force-pushed the auto_dep_tracking branch from f967371 to a1a7677 Compare July 10, 2026 15:43
@rdevshp

rdevshp commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

With this patch, I get these dependency files generated by the compiler:

gcc:

$ gcc --version
gcc (Debian 15.3.0-1) 15.3.0
Copyright (C) 2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ CC=gcc make
gcc  -std=c23 -pipe -O3 -flto -fPIC -fvisibility=hidden -fno-plt -fstack-clash-protection -fcf-protection -fstack-protector-strong -Wall -Wextra -Wcast-align=strict -Wcast-qual -Wwrite-strings -Wundef -Werror -march=native -Wmissing-prototypes -Wstrict-prototypes  -D_GNU_SOURCE -I include -DCONFIG_SEAL_METADATA=false -DZERO_ON_FREE=true -DWRITE_AFTER_FREE_CHECK=true -DSLOT_RANDOMIZE=true -DSLAB_CANARY=true -DSLAB_QUARANTINE_RANDOM_LENGTH=1 -DSLAB_QUARANTINE_QUEUE_LENGTH=1 -DCONFIG_EXTENDED_SIZE_CLASSES=true -DCONFIG_LARGE_SIZE_CLASSES=true -DGUARD_SLABS_INTERVAL=1 -DGUARD_SIZE_DIVISOR=2 -DREGION_QUARANTINE_RANDOM_LENGTH=256 -DREGION_QUARANTINE_QUEUE_LENGTH=1024 -DREGION_QUARANTINE_SKIP_THRESHOLD=33554432  -DFREE_SLABS_QUARANTINE_RANDOM_LENGTH=32 -DCONFIG_CLASS_REGION_SIZE=34359738368  -DN_ARENA=4 -DCONFIG_STATS=false -DCONFIG_SELF_INIT=true -DCONFIG_LABEL_MEMORY=false  -c -MMD -MP -MF out/chacha.d -MT out/chacha.o -o out/chacha.o chacha.c
gcc  -std=c23 -pipe -O3 -flto -fPIC -fvisibility=hidden -fno-plt -fstack-clash-protection -fcf-protection -fstack-protector-strong -Wall -Wextra -Wcast-align=strict -Wcast-qual -Wwrite-strings -Wundef -Werror -march=native -Wmissing-prototypes -Wstrict-prototypes  -D_GNU_SOURCE -I include -DCONFIG_SEAL_METADATA=false -DZERO_ON_FREE=true -DWRITE_AFTER_FREE_CHECK=true -DSLOT_RANDOMIZE=true -DSLAB_CANARY=true -DSLAB_QUARANTINE_RANDOM_LENGTH=1 -DSLAB_QUARANTINE_QUEUE_LENGTH=1 -DCONFIG_EXTENDED_SIZE_CLASSES=true -DCONFIG_LARGE_SIZE_CLASSES=true -DGUARD_SLABS_INTERVAL=1 -DGUARD_SIZE_DIVISOR=2 -DREGION_QUARANTINE_RANDOM_LENGTH=256 -DREGION_QUARANTINE_QUEUE_LENGTH=1024 -DREGION_QUARANTINE_SKIP_THRESHOLD=33554432  -DFREE_SLABS_QUARANTINE_RANDOM_LENGTH=32 -DCONFIG_CLASS_REGION_SIZE=34359738368  -DN_ARENA=4 -DCONFIG_STATS=false -DCONFIG_SELF_INIT=true -DCONFIG_LABEL_MEMORY=false  -c -MMD -MP -MF out/h_malloc.d -MT out/h_malloc.o -o out/h_malloc.o h_malloc.c
gcc  -std=c23 -pipe -O3 -flto -fPIC -fvisibility=hidden -fno-plt -fstack-clash-protection -fcf-protection -fstack-protector-strong -Wall -Wextra -Wcast-align=strict -Wcast-qual -Wwrite-strings -Wundef -Werror -march=native -Wmissing-prototypes -Wstrict-prototypes  -D_GNU_SOURCE -I include -DCONFIG_SEAL_METADATA=false -DZERO_ON_FREE=true -DWRITE_AFTER_FREE_CHECK=true -DSLOT_RANDOMIZE=true -DSLAB_CANARY=true -DSLAB_QUARANTINE_RANDOM_LENGTH=1 -DSLAB_QUARANTINE_QUEUE_LENGTH=1 -DCONFIG_EXTENDED_SIZE_CLASSES=true -DCONFIG_LARGE_SIZE_CLASSES=true -DGUARD_SLABS_INTERVAL=1 -DGUARD_SIZE_DIVISOR=2 -DREGION_QUARANTINE_RANDOM_LENGTH=256 -DREGION_QUARANTINE_QUEUE_LENGTH=1024 -DREGION_QUARANTINE_SKIP_THRESHOLD=33554432  -DFREE_SLABS_QUARANTINE_RANDOM_LENGTH=32 -DCONFIG_CLASS_REGION_SIZE=34359738368  -DN_ARENA=4 -DCONFIG_STATS=false -DCONFIG_SELF_INIT=true -DCONFIG_LABEL_MEMORY=false  -c -MMD -MP -MF out/memory.d -MT out/memory.o -o out/memory.o memory.c
gcc  -std=c23 -pipe -O3 -flto -fPIC -fvisibility=hidden -fno-plt -fstack-clash-protection -fcf-protection -fstack-protector-strong -Wall -Wextra -Wcast-align=strict -Wcast-qual -Wwrite-strings -Wundef -Werror -march=native -Wmissing-prototypes -Wstrict-prototypes  -D_GNU_SOURCE -I include -DCONFIG_SEAL_METADATA=false -DZERO_ON_FREE=true -DWRITE_AFTER_FREE_CHECK=true -DSLOT_RANDOMIZE=true -DSLAB_CANARY=true -DSLAB_QUARANTINE_RANDOM_LENGTH=1 -DSLAB_QUARANTINE_QUEUE_LENGTH=1 -DCONFIG_EXTENDED_SIZE_CLASSES=true -DCONFIG_LARGE_SIZE_CLASSES=true -DGUARD_SLABS_INTERVAL=1 -DGUARD_SIZE_DIVISOR=2 -DREGION_QUARANTINE_RANDOM_LENGTH=256 -DREGION_QUARANTINE_QUEUE_LENGTH=1024 -DREGION_QUARANTINE_SKIP_THRESHOLD=33554432  -DFREE_SLABS_QUARANTINE_RANDOM_LENGTH=32 -DCONFIG_CLASS_REGION_SIZE=34359738368  -DN_ARENA=4 -DCONFIG_STATS=false -DCONFIG_SELF_INIT=true -DCONFIG_LABEL_MEMORY=false  -c -MMD -MP -MF out/pages.d -MT out/pages.o -o out/pages.o pages.c
gcc  -std=c23 -pipe -O3 -flto -fPIC -fvisibility=hidden -fno-plt -fstack-clash-protection -fcf-protection -fstack-protector-strong -Wall -Wextra -Wcast-align=strict -Wcast-qual -Wwrite-strings -Wundef -Werror -march=native -Wmissing-prototypes -Wstrict-prototypes  -D_GNU_SOURCE -I include -DCONFIG_SEAL_METADATA=false -DZERO_ON_FREE=true -DWRITE_AFTER_FREE_CHECK=true -DSLOT_RANDOMIZE=true -DSLAB_CANARY=true -DSLAB_QUARANTINE_RANDOM_LENGTH=1 -DSLAB_QUARANTINE_QUEUE_LENGTH=1 -DCONFIG_EXTENDED_SIZE_CLASSES=true -DCONFIG_LARGE_SIZE_CLASSES=true -DGUARD_SLABS_INTERVAL=1 -DGUARD_SIZE_DIVISOR=2 -DREGION_QUARANTINE_RANDOM_LENGTH=256 -DREGION_QUARANTINE_QUEUE_LENGTH=1024 -DREGION_QUARANTINE_SKIP_THRESHOLD=33554432  -DFREE_SLABS_QUARANTINE_RANDOM_LENGTH=32 -DCONFIG_CLASS_REGION_SIZE=34359738368  -DN_ARENA=4 -DCONFIG_STATS=false -DCONFIG_SELF_INIT=true -DCONFIG_LABEL_MEMORY=false  -c -MMD -MP -MF out/random.d -MT out/random.o -o out/random.o random.c
gcc  -std=c23 -pipe -O3 -flto -fPIC -fvisibility=hidden -fno-plt -fstack-clash-protection -fcf-protection -fstack-protector-strong -Wall -Wextra -Wcast-align=strict -Wcast-qual -Wwrite-strings -Wundef -Werror -march=native -Wmissing-prototypes -Wstrict-prototypes  -D_GNU_SOURCE -I include -DCONFIG_SEAL_METADATA=false -DZERO_ON_FREE=true -DWRITE_AFTER_FREE_CHECK=true -DSLOT_RANDOMIZE=true -DSLAB_CANARY=true -DSLAB_QUARANTINE_RANDOM_LENGTH=1 -DSLAB_QUARANTINE_QUEUE_LENGTH=1 -DCONFIG_EXTENDED_SIZE_CLASSES=true -DCONFIG_LARGE_SIZE_CLASSES=true -DGUARD_SLABS_INTERVAL=1 -DGUARD_SIZE_DIVISOR=2 -DREGION_QUARANTINE_RANDOM_LENGTH=256 -DREGION_QUARANTINE_QUEUE_LENGTH=1024 -DREGION_QUARANTINE_SKIP_THRESHOLD=33554432  -DFREE_SLABS_QUARANTINE_RANDOM_LENGTH=32 -DCONFIG_CLASS_REGION_SIZE=34359738368  -DN_ARENA=4 -DCONFIG_STATS=false -DCONFIG_SELF_INIT=true -DCONFIG_LABEL_MEMORY=false  -c -MMD -MP -MF out/util.d -MT out/util.o -o out/util.o util.c
gcc  -std=c++17 -fsized-deallocation -pipe -O3 -flto -fPIC -fvisibility=hidden -fno-plt -fstack-clash-protection -fcf-protection -fstack-protector-strong -Wall -Wextra -Wcast-align=strict -Wcast-qual -Wwrite-strings -Wundef -Werror -march=native  -D_GNU_SOURCE -I include -DCONFIG_SEAL_METADATA=false -DZERO_ON_FREE=true -DWRITE_AFTER_FREE_CHECK=true -DSLOT_RANDOMIZE=true -DSLAB_CANARY=true -DSLAB_QUARANTINE_RANDOM_LENGTH=1 -DSLAB_QUARANTINE_QUEUE_LENGTH=1 -DCONFIG_EXTENDED_SIZE_CLASSES=true -DCONFIG_LARGE_SIZE_CLASSES=true -DGUARD_SLABS_INTERVAL=1 -DGUARD_SIZE_DIVISOR=2 -DREGION_QUARANTINE_RANDOM_LENGTH=256 -DREGION_QUARANTINE_QUEUE_LENGTH=1024 -DREGION_QUARANTINE_SKIP_THRESHOLD=33554432  -DFREE_SLABS_QUARANTINE_RANDOM_LENGTH=32 -DCONFIG_CLASS_REGION_SIZE=34359738368  -DN_ARENA=4 -DCONFIG_STATS=false -DCONFIG_SELF_INIT=true -DCONFIG_LABEL_MEMORY=false  -c -MMD -MP -MF out/new.d -MT out/new.o -o out/new.o new.cc
gcc  -std=c23 -pipe -O3 -flto -fPIC -fvisibility=hidden -fno-plt -fstack-clash-protection -fcf-protection -fstack-protector-strong -Wall -Wextra -Wcast-align=strict -Wcast-qual -Wwrite-strings -Wundef -Werror -march=native -Wmissing-prototypes -Wstrict-prototypes  -Wl,-O1,--as-needed,-z,defs,-z,relro,-z,now,-z,nodlopen,-z,text -shared out/chacha.o out/h_malloc.o out/memory.o out/pages.o out/random.o out/util.o out/new.o -lstdc++ -o out/libhardened_malloc.so

$ for i in $(ls out/*.d); do echo "=== $i ==="; cat $i; done;
=== out/chacha.d ===
out/chacha.o: chacha.c chacha.h util.h
chacha.h:
util.h:
=== out/h_malloc.d ===
out/h_malloc.o: h_malloc.c third_party/libdivide.h include/h_malloc.h \
 memory.h memtag.h util.h mutex.h pages.h random.h chacha.h
third_party/libdivide.h:
include/h_malloc.h:
memory.h:
memtag.h:
util.h:
mutex.h:
pages.h:
random.h:
chacha.h:
=== out/memory.d ===
out/memory.o: memory.c memory.h util.h
memory.h:
util.h:
=== out/new.d ===
out/new.o: new.cc include/h_malloc.h util.h
include/h_malloc.h:
util.h:
=== out/pages.d ===
out/pages.o: pages.c memory.h pages.h util.h
memory.h:
pages.h:
util.h:
=== out/random.d ===
out/random.o: random.c chacha.h util.h random.h
chacha.h:
util.h:
random.h:
=== out/util.d ===
out/util.o: util.c util.h
util.h:

clang:

$ clang --version
Debian clang version 21.1.8 (7+b3)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm-21/bin

$ CC=clang make
clang  -std=c23 -pipe -O3 -flto -fPIC -fvisibility=hidden -fno-plt -fstack-clash-protection -fcf-protection -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wwrite-strings -Wundef -Werror -march=native -Wmissing-prototypes -Wstrict-prototypes  -D_GNU_SOURCE -I include -DCONFIG_SEAL_METADATA=false -DZERO_ON_FREE=true -DWRITE_AFTER_FREE_CHECK=true -DSLOT_RANDOMIZE=true -DSLAB_CANARY=true -DSLAB_QUARANTINE_RANDOM_LENGTH=1 -DSLAB_QUARANTINE_QUEUE_LENGTH=1 -DCONFIG_EXTENDED_SIZE_CLASSES=true -DCONFIG_LARGE_SIZE_CLASSES=true -DGUARD_SLABS_INTERVAL=1 -DGUARD_SIZE_DIVISOR=2 -DREGION_QUARANTINE_RANDOM_LENGTH=256 -DREGION_QUARANTINE_QUEUE_LENGTH=1024 -DREGION_QUARANTINE_SKIP_THRESHOLD=33554432  -DFREE_SLABS_QUARANTINE_RANDOM_LENGTH=32 -DCONFIG_CLASS_REGION_SIZE=34359738368  -DN_ARENA=4 -DCONFIG_STATS=false -DCONFIG_SELF_INIT=true -DCONFIG_LABEL_MEMORY=false  -c -MMD -MP -MF out/chacha.d -MT out/chacha.o -o out/chacha.o chacha.c
clang  -std=c23 -pipe -O3 -flto -fPIC -fvisibility=hidden -fno-plt -fstack-clash-protection -fcf-protection -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wwrite-strings -Wundef -Werror -march=native -Wmissing-prototypes -Wstrict-prototypes  -D_GNU_SOURCE -I include -DCONFIG_SEAL_METADATA=false -DZERO_ON_FREE=true -DWRITE_AFTER_FREE_CHECK=true -DSLOT_RANDOMIZE=true -DSLAB_CANARY=true -DSLAB_QUARANTINE_RANDOM_LENGTH=1 -DSLAB_QUARANTINE_QUEUE_LENGTH=1 -DCONFIG_EXTENDED_SIZE_CLASSES=true -DCONFIG_LARGE_SIZE_CLASSES=true -DGUARD_SLABS_INTERVAL=1 -DGUARD_SIZE_DIVISOR=2 -DREGION_QUARANTINE_RANDOM_LENGTH=256 -DREGION_QUARANTINE_QUEUE_LENGTH=1024 -DREGION_QUARANTINE_SKIP_THRESHOLD=33554432  -DFREE_SLABS_QUARANTINE_RANDOM_LENGTH=32 -DCONFIG_CLASS_REGION_SIZE=34359738368  -DN_ARENA=4 -DCONFIG_STATS=false -DCONFIG_SELF_INIT=true -DCONFIG_LABEL_MEMORY=false  -c -MMD -MP -MF out/h_malloc.d -MT out/h_malloc.o -o out/h_malloc.o h_malloc.c
clang  -std=c23 -pipe -O3 -flto -fPIC -fvisibility=hidden -fno-plt -fstack-clash-protection -fcf-protection -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wwrite-strings -Wundef -Werror -march=native -Wmissing-prototypes -Wstrict-prototypes  -D_GNU_SOURCE -I include -DCONFIG_SEAL_METADATA=false -DZERO_ON_FREE=true -DWRITE_AFTER_FREE_CHECK=true -DSLOT_RANDOMIZE=true -DSLAB_CANARY=true -DSLAB_QUARANTINE_RANDOM_LENGTH=1 -DSLAB_QUARANTINE_QUEUE_LENGTH=1 -DCONFIG_EXTENDED_SIZE_CLASSES=true -DCONFIG_LARGE_SIZE_CLASSES=true -DGUARD_SLABS_INTERVAL=1 -DGUARD_SIZE_DIVISOR=2 -DREGION_QUARANTINE_RANDOM_LENGTH=256 -DREGION_QUARANTINE_QUEUE_LENGTH=1024 -DREGION_QUARANTINE_SKIP_THRESHOLD=33554432  -DFREE_SLABS_QUARANTINE_RANDOM_LENGTH=32 -DCONFIG_CLASS_REGION_SIZE=34359738368  -DN_ARENA=4 -DCONFIG_STATS=false -DCONFIG_SELF_INIT=true -DCONFIG_LABEL_MEMORY=false  -c -MMD -MP -MF out/memory.d -MT out/memory.o -o out/memory.o memory.c
clang  -std=c23 -pipe -O3 -flto -fPIC -fvisibility=hidden -fno-plt -fstack-clash-protection -fcf-protection -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wwrite-strings -Wundef -Werror -march=native -Wmissing-prototypes -Wstrict-prototypes  -D_GNU_SOURCE -I include -DCONFIG_SEAL_METADATA=false -DZERO_ON_FREE=true -DWRITE_AFTER_FREE_CHECK=true -DSLOT_RANDOMIZE=true -DSLAB_CANARY=true -DSLAB_QUARANTINE_RANDOM_LENGTH=1 -DSLAB_QUARANTINE_QUEUE_LENGTH=1 -DCONFIG_EXTENDED_SIZE_CLASSES=true -DCONFIG_LARGE_SIZE_CLASSES=true -DGUARD_SLABS_INTERVAL=1 -DGUARD_SIZE_DIVISOR=2 -DREGION_QUARANTINE_RANDOM_LENGTH=256 -DREGION_QUARANTINE_QUEUE_LENGTH=1024 -DREGION_QUARANTINE_SKIP_THRESHOLD=33554432  -DFREE_SLABS_QUARANTINE_RANDOM_LENGTH=32 -DCONFIG_CLASS_REGION_SIZE=34359738368  -DN_ARENA=4 -DCONFIG_STATS=false -DCONFIG_SELF_INIT=true -DCONFIG_LABEL_MEMORY=false  -c -MMD -MP -MF out/pages.d -MT out/pages.o -o out/pages.o pages.c
clang  -std=c23 -pipe -O3 -flto -fPIC -fvisibility=hidden -fno-plt -fstack-clash-protection -fcf-protection -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wwrite-strings -Wundef -Werror -march=native -Wmissing-prototypes -Wstrict-prototypes  -D_GNU_SOURCE -I include -DCONFIG_SEAL_METADATA=false -DZERO_ON_FREE=true -DWRITE_AFTER_FREE_CHECK=true -DSLOT_RANDOMIZE=true -DSLAB_CANARY=true -DSLAB_QUARANTINE_RANDOM_LENGTH=1 -DSLAB_QUARANTINE_QUEUE_LENGTH=1 -DCONFIG_EXTENDED_SIZE_CLASSES=true -DCONFIG_LARGE_SIZE_CLASSES=true -DGUARD_SLABS_INTERVAL=1 -DGUARD_SIZE_DIVISOR=2 -DREGION_QUARANTINE_RANDOM_LENGTH=256 -DREGION_QUARANTINE_QUEUE_LENGTH=1024 -DREGION_QUARANTINE_SKIP_THRESHOLD=33554432  -DFREE_SLABS_QUARANTINE_RANDOM_LENGTH=32 -DCONFIG_CLASS_REGION_SIZE=34359738368  -DN_ARENA=4 -DCONFIG_STATS=false -DCONFIG_SELF_INIT=true -DCONFIG_LABEL_MEMORY=false  -c -MMD -MP -MF out/random.d -MT out/random.o -o out/random.o random.c
clang  -std=c23 -pipe -O3 -flto -fPIC -fvisibility=hidden -fno-plt -fstack-clash-protection -fcf-protection -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wwrite-strings -Wundef -Werror -march=native -Wmissing-prototypes -Wstrict-prototypes  -D_GNU_SOURCE -I include -DCONFIG_SEAL_METADATA=false -DZERO_ON_FREE=true -DWRITE_AFTER_FREE_CHECK=true -DSLOT_RANDOMIZE=true -DSLAB_CANARY=true -DSLAB_QUARANTINE_RANDOM_LENGTH=1 -DSLAB_QUARANTINE_QUEUE_LENGTH=1 -DCONFIG_EXTENDED_SIZE_CLASSES=true -DCONFIG_LARGE_SIZE_CLASSES=true -DGUARD_SLABS_INTERVAL=1 -DGUARD_SIZE_DIVISOR=2 -DREGION_QUARANTINE_RANDOM_LENGTH=256 -DREGION_QUARANTINE_QUEUE_LENGTH=1024 -DREGION_QUARANTINE_SKIP_THRESHOLD=33554432  -DFREE_SLABS_QUARANTINE_RANDOM_LENGTH=32 -DCONFIG_CLASS_REGION_SIZE=34359738368  -DN_ARENA=4 -DCONFIG_STATS=false -DCONFIG_SELF_INIT=true -DCONFIG_LABEL_MEMORY=false  -c -MMD -MP -MF out/util.d -MT out/util.o -o out/util.o util.c
clang  -std=c++17 -fsized-deallocation -pipe -O3 -flto -fPIC -fvisibility=hidden -fno-plt -fstack-clash-protection -fcf-protection -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wwrite-strings -Wundef -Werror -march=native  -D_GNU_SOURCE -I include -DCONFIG_SEAL_METADATA=false -DZERO_ON_FREE=true -DWRITE_AFTER_FREE_CHECK=true -DSLOT_RANDOMIZE=true -DSLAB_CANARY=true -DSLAB_QUARANTINE_RANDOM_LENGTH=1 -DSLAB_QUARANTINE_QUEUE_LENGTH=1 -DCONFIG_EXTENDED_SIZE_CLASSES=true -DCONFIG_LARGE_SIZE_CLASSES=true -DGUARD_SLABS_INTERVAL=1 -DGUARD_SIZE_DIVISOR=2 -DREGION_QUARANTINE_RANDOM_LENGTH=256 -DREGION_QUARANTINE_QUEUE_LENGTH=1024 -DREGION_QUARANTINE_SKIP_THRESHOLD=33554432  -DFREE_SLABS_QUARANTINE_RANDOM_LENGTH=32 -DCONFIG_CLASS_REGION_SIZE=34359738368  -DN_ARENA=4 -DCONFIG_STATS=false -DCONFIG_SELF_INIT=true -DCONFIG_LABEL_MEMORY=false  -c -MMD -MP -MF out/new.d -MT out/new.o -o out/new.o new.cc
clang  -std=c23 -pipe -O3 -flto -fPIC -fvisibility=hidden -fno-plt -fstack-clash-protection -fcf-protection -fstack-protector-strong -Wall -Wextra -Wcast-align -Wcast-qual -Wwrite-strings -Wundef -Werror -march=native -Wmissing-prototypes -Wstrict-prototypes  -Wl,-O1,--as-needed,-z,defs,-z,relro,-z,now,-z,nodlopen,-z,text -shared out/chacha.o out/h_malloc.o out/memory.o out/pages.o out/random.o out/util.o out/new.o -lstdc++ -o out/libhardened_malloc.so

$ for i in $(ls out/*.d); do echo "=== $i ==="; cat $i; done;
=== out/chacha.d ===
out/chacha.o: chacha.c chacha.h util.h
chacha.h:
util.h:
=== out/h_malloc.d ===
out/h_malloc.o: h_malloc.c third_party/libdivide.h include/h_malloc.h \
  memory.h memtag.h util.h mutex.h pages.h random.h chacha.h
third_party/libdivide.h:
include/h_malloc.h:
memory.h:
memtag.h:
util.h:
mutex.h:
pages.h:
random.h:
chacha.h:
=== out/memory.d ===
out/memory.o: memory.c memory.h util.h
memory.h:
util.h:
=== out/new.d ===
out/new.o: new.cc include/h_malloc.h util.h
include/h_malloc.h:
util.h:
=== out/pages.d ===
out/pages.o: pages.c memory.h pages.h util.h
memory.h:
pages.h:
util.h:
=== out/random.d ===
out/random.o: random.c chacha.h util.h random.h
chacha.h:
util.h:
random.h:
=== out/util.d ===
out/util.o: util.c util.h
util.h:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant