Re: importC with gc-sections not work on linux

2024-02-26 Thread Dakota via Digitalmars-d-learn
On Monday, 26 February 2024 at 12:33:02 UTC, Richard (Rikki) Andrew Cattermole wrote: On 27/02/2024 1:28 AM, Dakota wrote: When I use importC to build a c library, there is a lot unused symbol missing. I try add `-L--gc-sections` to dmd to workaround this issue. This removes symbols, not kee

Re: importC with gc-sections not work on linux

2024-02-26 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
On 27/02/2024 1:28 AM, Dakota wrote: When I use importC to build a c library, there is a lot unused symbol missing. I try add `-L--gc-sections` to dmd to workaround this issue. This removes symbols, not keeps them. You want the linker flag: ``--no-gc-sections`` "Enable garbage collection of

importC with gc-sections not work on linux

2024-02-26 Thread Dakota via Digitalmars-d-learn
When I use importC to build a c library, there is a lot unused symbol missing. I try add `-L--gc-sections` to dmd to workaround this issue. I also try `-L-dead_strip` on macOS, it work as expected. I do some google, some one suggestion use with `-ffunction-sections`, `-f fdata-sections`, d