Re: Compiler-generated implicit symbols and --gc-sections

2014-01-19 Thread Mike
On Thursday, 9 January 2014 at 07:51:48 UTC, Mike wrote: On Tuesday, 7 January 2014 at 11:04:45 UTC, Joakim wrote: I ran into this recently when compiling for Android/x86, as the Android NDK linker calls --gc-sections by default. I was able to reproduce the segfault with dmd compiling a linux/

Re: Compiler-generated implicit symbols and --gc-sections

2014-01-09 Thread Joakim
On Thursday, 9 January 2014 at 10:15:46 UTC, Mike wrote: On Thursday, 9 January 2014 at 07:51:48 UTC, Mike wrote: On Tuesday, 7 January 2014 at 11:04:45 UTC, Joakim wrote: I ran into this recently when compiling for Android/x86, as the Android NDK linker calls --gc-sections by default. I was

Re: Compiler-generated implicit symbols and --gc-sections

2014-01-08 Thread Mike
On Tuesday, 7 January 2014 at 11:04:45 UTC, Joakim wrote: I ran into this recently when compiling for Android/x86, as the Android NDK linker calls --gc-sections by default. I was able to reproduce the segfault with dmd compiling a linux/x86 executable with the --gc-sections flag added to the l

Re: Compiler-generated implicit symbols and --gc-sections

2014-01-07 Thread Joakim
On Tuesday, 7 January 2014 at 02:17:46 UTC, Mike wrote: On Monday, 6 January 2014 at 18:59:00 UTC, Iain Buclaw wrote: On 6 Jan 2014 13:45, "Dicebot" wrote: On Friday, 3 January 2014 at 18:14:58 UTC, Mike wrote: I eventually tracked it down to the fact that I was compiling with -ffunction-s

Re: Compiler-generated implicit symbols and --gc-sections

2014-01-06 Thread Dicebot
On Monday, 6 January 2014 at 18:59:00 UTC, Iain Buclaw wrote: Of course ! --gc-sections is just a dirty hack. If you want smaller binaries, then you are better off aiding the shared library support. :) I don't ever recall any of the core maintainers ever endorsing that switch anyway H

Re: Compiler-generated implicit symbols and --gc-sections

2014-01-06 Thread Mike
On Monday, 6 January 2014 at 18:59:00 UTC, Iain Buclaw wrote: On 6 Jan 2014 13:45, "Dicebot" wrote: On Friday, 3 January 2014 at 18:14:58 UTC, Mike wrote: I eventually tracked it down to the fact that I was compiling with -ffunction-sections and -fdata-sections and linking with --gc-sectio

Re: Compiler-generated implicit symbols and --gc-sections

2014-01-06 Thread Iain Buclaw
On 6 Jan 2014 13:45, "Dicebot" wrote: > > On Friday, 3 January 2014 at 18:14:58 UTC, Mike wrote: >> >> I eventually tracked it down to the fact that I was compiling with -ffunction-sections and -fdata-sections and linking with --gc-sections and symbols like... > > > I never got --gc-sections to wo

Re: Compiler-generated implicit symbols and --gc-sections

2014-01-06 Thread Dicebot
On Friday, 3 January 2014 at 18:14:58 UTC, Mike wrote: I eventually tracked it down to the fact that I was compiling with -ffunction-sections and -fdata-sections and linking with --gc-sections and symbols like... I never got --gc-sections to work reliably with D without going dirty, crashes w

Re: Compiler-generated implicit symbols and --gc-sections

2014-01-06 Thread Dicebot
On Saturday, 4 January 2014 at 07:59:55 UTC, Timo Sintonen wrote: In dmd and ides it is common to compile and link everything at once. the compiler has all information available and may remove unused code and data. Actually no D compiler does it out of the box as far as I am aware. It is a bi

Re: Compiler-generated implicit symbols and --gc-sections

2014-01-04 Thread Timo Sintonen
On Friday, 3 January 2014 at 18:14:58 UTC, Mike wrote: I ran into a problem recently that resulted in a segmentation fault in my program whenever I called a member function of one of my classes. Sometimes it occurred and sometimes it didn't depending on the order of certain things in my code.