Hi, I am trying with gdc to create the equivalent of a fat jar. So for that I would need the standard dlang library included in the object or library file. Does somebody know the needed gdc flags?
I am using mips64-linux-gnuabi64-gdc-12.
pizza_dox_9999
Thread overview | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
January 05, 2024 Create a self contained object file like fat jars from java | ||||
---|---|---|---|---|
| ||||
January 07, 2024 Re: Create a self contained object file like fat jars from java | ||||
---|---|---|---|---|
| ||||
Posted in reply to pizza_dox_9999 | On Friday, 5 January 2024 at 22:10:31 UTC, pizza_dox_9999 wrote: >Hi, I am trying with gdc to create the equivalent of a fat jar. So for that I would need the standard dlang library included in the object or library file. Does somebody know the needed gdc flags? Did you try using dub and specifying See https://dub.pm/dub-reference/build_settings/#targetpath Even if you just want the right flags, this could help as you can "ask" dub to print the flags it's using with |
January 14 Re: Create a self contained object file like fat jars from java | ||||
---|---|---|---|---|
| ||||
Posted in reply to Renato | On Sunday, 7 January 2024 at 18:14:12 UTC, Renato wrote: >On Friday, 5 January 2024 at 22:10:31 UTC, pizza_dox_9999 wrote: >Hi, I am trying with gdc to create the equivalent of a fat jar. So for that I would need the standard dlang library included in the object or library file. Does somebody know the needed gdc flags? Did you try using dub and specifying See https://dub.pm/dub-reference/build_settings/#targetpath Even if you just want the right flags, this could help as you can "ask" dub to print the flags it's using with Thank you for the information. Sadly nothing for gdc directly. But how is dub solving my problem? Is the buildstep creating a "fat jar". So instead of compiling multiple .d files with gdc I would only compile the "fat jar" from dub? |
January 14 Re: Create a self contained object file like fat jars from java | ||||
---|---|---|---|---|
| ||||
Posted in reply to pizza_dox_9999 | On Sunday, 14 January 2024 at 09:36:16 UTC, pizza_dox_9999 wrote: >On Sunday, 7 January 2024 at 18:14:12 UTC, Renato wrote: >On Friday, 5 January 2024 at 22:10:31 UTC, pizza_dox_9999 wrote: >Hi, I am trying with gdc to create the equivalent of a fat jar. So for that I would need the standard dlang library included in the object or library file. Does somebody know the needed gdc flags? Did you try using dub and specifying See https://dub.pm/dub-reference/build_settings/#targetpath Even if you just want the right flags, this could help as you can "ask" dub to print the flags it's using with Thank you for the information. Sadly nothing for gdc directly. But how is dub solving my problem? Is the buildstep creating a "fat jar". So instead of compiling multiple .d files with gdc I would only compile the "fat jar" from dub? I think you misunderstood me. When you tell dub to build a static library (equivalent to "fat jar" for D) it will use whatever compiler options are needed to do so... you can run |
January 14 Re: Create a self contained object file like fat jars from java | ||||
---|---|---|---|---|
| ||||
Posted in reply to Renato | On 08/01/2024 7:14 AM, Renato wrote:
> On Friday, 5 January 2024 at 22:10:31 UTC, pizza_dox_9999 wrote:
>> Hi, I am trying with gdc to create the equivalent of a fat jar. So for that I would need the standard dlang library included in the object or library file. Does somebody know the needed gdc flags?
>> I am using mips64-linux-gnuabi64-gdc-12.
>> pizza_dox_9999
>
> Did you try using dub and specifying `targetType="staticLibrary"`?
>
> See https://dub.pm/dub-reference/build_settings/#targetpath
>
> Even if you just want the right flags, this could help as you can "ask" dub to print the flags it's using with `dub build -v`.
Dub's static library target type does not include dependencies or druntime/phobos.
Typically static libraries do not combine to produce a bigger static library.
|
January 14 Re: Create a self contained object file like fat jars from java | ||||
---|---|---|---|---|
| ||||
Posted in reply to Richard (Rikki) Andrew Cattermole | On Sunday, 14 January 2024 at 10:05:12 UTC, Richard (Rikki) Andrew Cattermole wrote:
> On 08/01/2024 7:14 AM, Renato wrote:
>> On Friday, 5 January 2024 at 22:10:31 UTC, pizza_dox_9999 wrote:
>>> [...]
>>
>> Did you try using dub and specifying `targetType="staticLibrary"`?
>>
>> See https://dub.pm/dub-reference/build_settings/#targetpath
>>
>> Even if you just want the right flags, this could help as you can "ask" dub to print the flags it's using with `dub build -v`.
>
> Dub's static library target type does not include dependencies or druntime/phobos.
>
> Typically static libraries do not combine to produce a bigger static library.
But thats what I need and want.
|
January 15 Re: Create a self contained object file like fat jars from java | ||||
---|---|---|---|---|
| ||||
Posted in reply to pizza_dox_9999 | On 15/01/2024 12:42 AM, pizza_dox_9999 wrote:
> On Sunday, 14 January 2024 at 10:05:12 UTC, Richard (Rikki) Andrew Cattermole wrote:
>> On 08/01/2024 7:14 AM, Renato wrote:
>>> On Friday, 5 January 2024 at 22:10:31 UTC, pizza_dox_9999 wrote:
>>>> [...]
>>>
>>> Did you try using dub and specifying `targetType="staticLibrary"`?
>>>
>>> See https://dub.pm/dub-reference/build_settings/#targetpath
>>>
>>> Even if you just want the right flags, this could help as you can "ask" dub to print the flags it's using with `dub build -v`.
>>
>> Dub's static library target type does not include dependencies or druntime/phobos.
>>
>> Typically static libraries do not combine to produce a bigger static library.
>
> But thats what I need and want.
Combining of static libraries is not specific to D.
Although you're going to need to figure out how to get a list of all the static libraries you want to combine. The actual combination should be pretty standard.
|
January 14 Re: Create a self contained object file like fat jars from java | ||||
---|---|---|---|---|
| ||||
Posted in reply to Richard (Rikki) Andrew Cattermole | OK to make it clear. I wanted to call d from c so that I can write a n64 game with d. But compiling the d object files while using higher features like classes, resulted in missing dependencys. So because GCC doesnt understands d I need an object file which has everything included d needs to run. Thats my understanding of this situation. |
January 15 Re: Create a self contained object file like fat jars from java | ||||
---|---|---|---|---|
| ||||
Posted in reply to pizza_dox_9999 | On 15/01/2024 12:47 AM, pizza_dox_9999 wrote:
> OK to make it clear. I wanted to call d from c so that I can write a n64 game with d. But compiling the d object files while using higher features like classes, resulted in missing dependencys. So because GCC doesnt understands d I need an object file which has everything included d needs to run. Thats my understanding of this situation.
My understanding is druntime is not ported to that platform.
Too limited in resources.
Getting a static library with all dependencies would not help you here.
But yes, GCC does understand D, using GDC which is built on top (same frontend as DMD and LDC).
You are either stuck using -betterC which does not support ``extern(D)`` classes, but does have ``extern(C++)`` classes. Or by using a custom runtime which you will likely have to write yourself and will likely break between compiler releases.
|
January 14 Re: Create a self contained object file like fat jars from java | ||||
---|---|---|---|---|
| ||||
Posted in reply to Richard (Rikki) Andrew Cattermole | On Sunday, 14 January 2024 at 11:54:09 UTC, Richard (Rikki) Andrew Cattermole wrote:
> On 15/01/2024 12:47 AM, pizza_dox_9999 wrote:
>> OK to make it clear. I wanted to call d from c so that I can write a n64 game with d. But compiling the d object files while using higher features like classes, resulted in missing dependencys. So because GCC doesnt understands d I need an object file which has everything included d needs to run. Thats my understanding of this situation.
>
> My understanding is druntime is not ported to that platform.
>
> Too limited in resources.
>
> Getting a static library with all dependencies would not help you here.
>
> But yes, GCC does understand D, using GDC which is built on top (same frontend as DMD and LDC).
>
> You are either stuck using -betterC which does not support ``extern(D)`` classes, but does have ``extern(C++)`` classes. Or by using a custom runtime which you will likely have to write yourself and will likely break between compiler releases.
Thank you for the clarification.
Are such things as string so platform dependent in d or the stuff for the class and interface declarations that they aren't cross platform? I meant the gcc used by the n64 toolchain (libdragon).
|