D.gnu - gdc 0.12 on linux - shared library status
- Peri Hankey (16/16) Jun 04 2005 Hello
- David Friedman (6/31) Jun 04 2005 Fix for assembler error and crashing:
- Peri Hankey (9/47) Jun 04 2005 David
Hello I have some 3000 lines of code in a library that works when linked as a static library, but always crashes after a while when linked as a dynamic library. When compiling to produce a shared library using '-fPIC -shared' I get many messages of the form "Error: junk `(%ecx)' after expression". If I just use '-shared' gdc produces a shared library, but this then crashes as outlined above. I take it that the -fPIC option is required, and that I am trying to run the wrong kind of code as shareable. So I suppose my real question is: are we a long way from being able to make shared libraries on Linux? The compiler is gdc-0.12-gcc-3.4.3 running in Mandrake 10.2 on a Celeron. It would be very good to have shared libraries working, and the code I am developing really needs to be available in that form. Regards Peri Hankey
Jun 04 2005
Peri Hankey wrote:Hello I have some 3000 lines of code in a library that works when linked as a static library, but always crashes after a while when linked as a dynamic library. When compiling to produce a shared library using '-fPIC -shared' I get many messages of the form "Error: junk `(%ecx)' after expression". If I just use '-shared' gdc produces a shared library, but this then crashes as outlined above. I take it that the -fPIC option is required, and that I am trying to run the wrong kind of code as shareable. So I suppose my real question is: are we a long way from being able to make shared libraries on Linux? The compiler is gdc-0.12-gcc-3.4.3 running in Mandrake 10.2 on a Celeron. It would be very good to have shared libraries working, and the code I am developing really needs to be available in that form. Regards Peri HankeyFix for assembler error and crashing: http://home.earthlink.net/~dvdfrdmn/d/gdc-0.12-pic.diff Shared libraries are supposed to be working now, but I had not been testing them interfaces and module dependencies. David
Jun 04 2005
David Friedman wrote:Peri Hankey wrote:David Thanks very much - that seems to have done the trick. I have now successfully combined a shared library written in D with code written in both D and C doing nontrivial things, and am very pleased. I'm aiming to surface soon with GPL stuff that I hope will be useful and interesting, and it should be more useful as a dynamic library. Regards PeriHello I have some 3000 lines of code in a library that works when linked as a static library, but always crashes after a while when linked as a dynamic library. When compiling to produce a shared library using '-fPIC -shared' I get many messages of the form "Error: junk `(%ecx)' after expression". If I just use '-shared' gdc produces a shared library, but this then crashes as outlined above. I take it that the -fPIC option is required, and that I am trying to run the wrong kind of code as shareable. So I suppose my real question is: are we a long way from being able to make shared libraries on Linux? The compiler is gdc-0.12-gcc-3.4.3 running in Mandrake 10.2 on a Celeron. It would be very good to have shared libraries working, and the code I am developing really needs to be available in that form. Regards Peri HankeyFix for assembler error and crashing: http://home.earthlink.net/~dvdfrdmn/d/gdc-0.12-pic.diff Shared libraries are supposed to be working now, but I had not been testing them interfaces and module dependencies. David
Jun 04 2005