blt / port_compiler

A rebar3 port compiler
MIT License
65 stars 38 forks source link

Drop "-g" flag from default options to reduce shared lib size #83

Closed Zabrane closed 1 month ago

Zabrane commented 1 month ago

Hi @tsloughter

Would it be possible to drop -g flag from pc_port_env.erl?

Keeping -g in the default settings leads to super large .so.

Here in a NIF example (cuckoo hashing):

# with "-g"
priv/cuckoo_hash.so -> 6.8M

# without "-g"
priv/cuckoo_hash.so -> 1.4M

If one wants to add debugging symbols, CFLAGS + LDFLAGS are there...thanks to port_compiler.

Many thanks /Z

tsloughter commented 1 month ago

I'd be fine with that. Can you send a PR? Then we'll want to let it wait for a day or two for comment.

Zabrane commented 1 month ago

I'd be fine with that. Can you send a PR? Then we'll want to let it wait for a day or two for comment.

Done.