• patch anyone?

    From janezz55@21:1/5 to All on Sat Jan 21 06:56:49 2023
    It should be easy to make std::trunc() work. First we need to cajole gcc into using C99 math.h (-D_GLIBCXX_USE_C99_MATH_TR1), then several ::using lines need to be removed and a trunc() implementation for double needs to be inserted. Will someone write
    the patch or do I need to?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Sat Jan 21 22:21:30 2023
    Hello,

    I'm working on a C++ project with DXE3 and found it cannot resolve throw_length_error() on dlopen().  Upon inspection, this is stemming
    from my use of std::vector in some places.  Is there a way to resolve it
    with DXE_EXPORT() without having to redo the code to not use
    std::vector?  Right now I'm just getting the mangled name for it, '`__ZSt20__throw_length_errorPKc''

    Thanks,
    Frank

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to djgpp@delorie.com] on Sun Jan 22 10:15:29 2023
    On 1/22/23, Frank Sapone (emoaddict15@gmail.com) [via
    djgpp@delorie.com] <djgpp@delorie.com> wrote:
    Hello,

    I'm working on a C++ project with DXE3 and found it cannot resolve throw_length_error() on dlopen(). Upon inspection, this is stemming
    from my use of std::vector in some places. Is there a way to resolve it
    with DXE_EXPORT() without having to redo the code to not use
    std::vector? Right now I'm just getting the mangled name for it, '`__ZSt20__throw_length_errorPKc''

    Do you not link to libstdc++ (and libgcc) ?
    If you really do and it still happens, then I don't know.

    Is the project open?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to djgpp@delorie.com] on Sun Jan 22 07:04:48 2023
    On 1/22/2023 2:15 AM, Ozkan Sezer (sezeroz@gmail.com) [via
    djgpp@delorie.com] wrote:
    On 1/22/23, Frank Sapone (emoaddict15@gmail.com) [via
    djgpp@delorie.com] <djgpp@delorie.com> wrote:
    Hello,

    I'm working on a C++ project with DXE3 and found it cannot resolve
    throw_length_error() on dlopen(). Upon inspection, this is stemming
    from my use of std::vector in some places. Is there a way to resolve it
    with DXE_EXPORT() without having to redo the code to not use
    std::vector? Right now I'm just getting the mangled name for it,
    '`__ZSt20__throw_length_errorPKc''
    Do you not link to libstdc++ (and libgcc) ?
    If you really do and it still happens, then I don't know.

    Is the project open?

    By link, you mean for dxe3gen?  If yes, then I tried that.  And no, the project is not open unfortunately.

    Syntax for building the DXE: 'dxe3gen -V -U -E _dll_Entry -lstdc++ -lgcc
    <my objs> <my dxe>'

    The interesting thing about the -lstdc++ -lc is that I'm using the
    Andrewwu cross-compiler which has mingw32 packaged and ready to go on Windows.  However, I had to copy libstdc++.a and libgcc.a from C:\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.4 to
    C:\djgpp\i586-pc-msdosdjgpp\lib which I suspect is incorrect and could
    be part of my issue here?

    Frank

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to Sounds correct from what you on Sun Jan 22 16:02:24 2023
    By link, you mean for dxe3gen?

    Yes

    If yes, then I tried that.

    Huh..

    And no, the project is not open unfortunately.

    Is this dk ?

    Syntax for building the DXE: 'dxe3gen -V -U -E _dll_Entry -lstdc++ -lgcc
    <my objs> <my dxe>'

    In sin, we used to do
    $(DXE3GEN) -V -U -E _GetGameAPI $(OBJECTS) $(DXE_LIBS) -o gamex86.dxe

    And it used to work. Maybe the order is important?
    Can't remember details.

    However, I had to copy libstdc++.a and libgcc.a from C:\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.4 to
    C:\djgpp\i586-pc-msdosdjgpp\lib

    Sounds correct from what you write,

    which I suspect is incorrect

    I don't see how..

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Sun Jan 22 17:11:30 2023
    Maybe. I'll give that a try tonight. The only difference from what
    I'm doing now is I'm doing DXE_LIBS /before/ the OBJECTS.

    I'd like to hear the result. Remember that
    dxe3gen --show-unres xxx.dxe
    will output the missing symbols in the dxe.

    However, I had to copy libstdc++.a and libgcc.a from
    C:\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.4 to
    C:\djgpp\i586-pc-msdosdjgpp\lib

    Sounds correct from what you write,

    Having to copy the lib? I dont remember doing that,

    I (we) had to do that when building game dxes of sin
    which link to libstdc++ and libgcc

    Just seems wrong to have to copy
    important libs like that?

    That's a shortcoming of dxe3gen with gcc-provided libraries,
    needs to be addressed but no one cared (or no one reported
    the issue probably.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to djgpp@delorie.com] on Sun Jan 22 08:33:58 2023
    On Sunday, January 22, 2023, Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com] <djgpp@delorie.com> wrote:


    And no, the project is not open unfortunately.

    Is this dk ?


    Yes



    Syntax for building the DXE: 'dxe3gen -V -U -E _dll_Entry -lstdc++ -lgcc <my objs> <my dxe>'

    In sin, we used to do
    $(DXE3GEN) -V -U -E _GetGameAPI $(OBJECTS) $(DXE_LIBS) -o gamex86.dxe

    And it used to work. Maybe the order is important?
    Can't remember details.


    Maybe. I'll give that a try tonight. The only difference from what I'm
    doing now is I'm doing DXE_LIBS /before/ the OBJECTS.



    However, I had to copy libstdc++.a and libgcc.a from C:\djgpp\lib\gcc\i586-pc-msdosdjgpp\4.9.4 to C:\djgpp\i586-pc-msdosdjgpp\lib

    Sounds correct from what you write,


    Having to copy the lib? I dont remember doing that, but its been a couple
    of years. Just seems wrong to have to copy important libs like that?

    Frank

    PS Apologies in advance for bad formatting, on a phone today.

    <br>On Sunday, January 22, 2023, Ozkan Sezer (<a href="mailto:sezeroz@gmail.com">sezeroz@gmail.com</a>) [via <a href="mailto:djgpp@delorie.com">djgpp@delorie.com</a>] &lt;<a href="mailto:djgpp@delorie.com">djgpp@deloriecom</a>&gt; wrote:<blockquote class=
    "gmail_quote" style="margin:0 0 0 8ex;border-left:1px #ccc solid;padding-left:1ex">

    &gt;  And no, the project is not open unfortunately.<br>

    Is this dk ?</blockquote><div> </div><div>Yes</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

    &gt; Syntax for building the DXE: &#39;dxe3gen -V -U -E _dll_Entry -lstdc++ -lgcc<br>
    &gt; &lt;my objs&gt; &lt;my dxe&gt;&#39;<br>

    In sin, we used to do<br>
      $(DXE3GEN) -V -U -E _GetGameAPI $(OBJECTS) $(DXE_LIBS) -o gamex86.dxe<br>

    And it used to work. Maybe the order is important?<br>
    Can&#39;t remember details.</blockquote><div><br></div><div>Maybe.  I&#39;ll give that a try tonight.  The only difference from what I&#39;m doing now is I&#39;m doing DXE_LIBS /before/ the OBJECTS.</div><div> </div><blockquote class="gmail_quote"
    style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

    &gt;   However, I had to copy libstdc++.a and libgcc.a from<br>
    &gt; C:\djgpp\lib\gcc\i586-pc-<wbr>msdosdjgpp\4.9.4 to<br>
    &gt; C:\djgpp\i586-pc-msdosdjgpp\<wbr>lib<br>

    Sounds correct from what you write,</blockquote><div><br></div><div>Having to copy the lib?  I dont remember doing that, but its been a couple of years.  Just seems wrong to have to copy important libs like that?</div><div><br></div><div>Frank</div><
    <br></div><div>PS Apologies in advance for bad formatting, on a phone today.</div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Sun Jan 22 20:23:57 2023
    Maybe. I'll give that a try tonight. The only difference from what
    I'm doing now is I'm doing DXE_LIBS /before/ the OBJECTS.
    I'd like to hear the result. Remember that
    dxe3gen --show-unres xxx.dxe
    will output the missing symbols in the dxe.

    Yes, this is exactly the problem.  So, apparently, you must do -l <your interesting libs> AFTER $(OBJECTS) otherwise it does not work.


    Just seems wrong to have to copy
    important libs like that?
    That's a shortcoming of dxe3gen with gcc-provided libraries,
    needs to be addressed but no one cared (or no one reported
    the issue probably.)

    Any possibility of you being able to generate a patch or can we get it
    into documentation?  I'd do it, but I really do not know as much about
    GCC and DJGPP inner-workings like you do. :)

    Thanks,
    Frank

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Mon Jan 23 07:00:48 2023
    Maybe. I'll give that a try tonight. The only difference from what
    I'm doing now is I'm doing DXE_LIBS /before/ the OBJECTS.
    I'd like to hear the result. Remember that
    dxe3gen --show-unres xxx.dxe
    will output the missing symbols in the dxe.

    Yes, this is exactly the problem. So, apparently, you must do
    -l <your interesting libs> AFTER $(OBJECTS) otherwise it does not
    work.

    Good to see that it now works.

    Just looked at dxe3gen documentation, and it says:

    Usage: dxe3gen [-o output.dxe] [options] [object-files] [ld-options]
    or: dxe3gen -1 output.dxe symbol input.o [input2.o ... -lgcc -lc]

    that 'ld-options' is always at the end which includes any link libs.
    So, the order of arguments _is_ important.

    Just seems wrong to have to copy
    important libs like that?
    That's a shortcoming of dxe3gen with gcc-provided libraries,
    needs to be addressed but no one cared (or no one reported
    the issue probably.)

    Any possibility of you being able to generate a patch or can we get
    it into documentation?

    The thing is, dxe3gen invokes ld, not gcc. gcc is a front-end to ld
    and handles any such ugliness behind the scene and doing the same for
    dxe3gen might be a real pain.

    If someone other than me can generate solution for this, or at least
    some documentation, it'd be nice.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to djgpp@delorie.com] on Mon Jan 23 19:06:35 2023
    On 2023-01-23 05:00, Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com] wrote:
    The thing is, dxe3gen invokes ld, not gcc. gcc is a front-end to ld
    and handles any such ugliness behind the scene and doing the same for
    dxe3gen might be a real pain.

    I think the tricky part is to prevent gcc from invoking stubify on the resulting object file. Otherwise, it doesn't look too difficult. Just replace param sequences such as "-T" "dxe.ld" with "-Wl,-T,dxe.ld". The same can be done for DXE_AS.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to djgpp@delorie.com] on Wed Jan 25 20:31:47 2023
    On 1/23/23 20:06, J.W. Jagersma (jwjagersma@gmail.com) [via djgpp@delorie.com] wrote:
    On 2023-01-23 05:00, Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com] wrote:
    The thing is, dxe3gen invokes ld, not gcc. gcc is a front-end to ld
    and handles any such ugliness behind the scene and doing the same for
    dxe3gen might be a real pain.
    I think the tricky part is to prevent gcc from invoking stubify on the resulting object file. Otherwise, it doesn't look too difficult. Just replace
    param sequences such as "-T" "dxe.ld" with "-Wl,-T,dxe.ld". The same can be done for DXE_AS.
    It is should be easy:

    1) dump GCC specs (gcc -dumpspecs >some_file

    2) delete next line after line containing '*post_link:'

    3)  use that file in  -T option


    Andris

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to djgpp@delorie.com] on Wed Jan 25 22:25:40 2023
    On 1/25/23, Andris Pavenis (andris.pavenis@iki.fi) [via
    djgpp@delorie.com] <djgpp@delorie.com> wrote:
    On 1/23/23 20:06, J.W. Jagersma (jwjagersma@gmail.com) [via djgpp@delorie.com] wrote:
    On 2023-01-23 05:00, Ozkan Sezer (sezeroz@gmail.com) [via
    djgpp@delorie.com] wrote:
    The thing is, dxe3gen invokes ld, not gcc. gcc is a front-end to ld
    and handles any such ugliness behind the scene and doing the same for
    dxe3gen might be a real pain.
    I think the tricky part is to prevent gcc from invoking stubify on the
    resulting object file. Otherwise, it doesn't look too difficult. Just
    replace
    param sequences such as "-T" "dxe.ld" with "-Wl,-T,dxe.ld". The same can
    be
    done for DXE_AS.
    It is should be easy:

    1) dump GCC specs (gcc -dumpspecs >some_file

    2) delete next line after line containing '*post_link:'

    3) use that file in -T option


    Andris

    No '*post_link:' in my gcc's dumpspecs (gcc-3.4.6, cross- from linux.)

    KmFzbToKCgoqYXNtX2RlYnVnOgole2dzdGFicyo6LS1nc3RhYnN9JXshZ3N0YWJzKjole2cqOi0t Z2R3YXJmMn19CgoqYXNtX2ZpbmFsOgoKCiphc21fb3B0aW9uczoKJWEgJVkgJXtjOiVXe28qfSV7 IW8qOi1vICV3JWIlT319JXshYzotbyAlZCV3JXUlT30KCippbnZva2VfYXM6CiV7IVM6LW8gJXwu cyB8CiBhcyAlKGFzbV9vcHRpb25zKSAlbS5zICVBIH0KCipjcHA6Ci1yZW1hcCAle3Bvc2l4Oi1E X1BPU0lYX1NPVVJDRX0gICAleyFub3N0ZGluYzotaW1hY3JvcyAlc2RqZ3BwLnZlcn0KCipjcHBf b3B0aW9uczoKJShjcHBfdW5pcXVlX29wdGlvbnMpICUxICV7bSp9ICV7c3RkKiZhbnNpJnRyaWdy YXBoc30gJXtXKiZwZWRhbnRpYyp9ICV7d30gJXtmKn0gJXtnKjoleyFnMDoleyFmbm8td29ya2lu Zy1kaXJlY3Rvcnk6LWZ3b3JraW5nLWRpcmVjdG9yeX19fSAle08qfSAle3VuZGVmfQoKKmNwcF9k ZWJ1Z19vcHRpb25zOgole2QqfQoKKmNwcF91bmlxdWVfb3B0aW9uczoKJXtDfENDOiV7IUU6JWVH Q0MgZG9lcyBub3Qgc3VwcG9ydCAtQyBvciAtQ0Mgd2l0aG91dCAtRX19ICV7IVE6LXF1aWV0fSAl e25vc3RkaW5jKn0gJXtDfSAle0NDfSAle3Z9ICV7SSp9ICV7UH0gJUkgJXtNRDotTUQgJXshbzol Yi5kfSV7byo6JS5kJSp9fSAle01NRDotTU1EICV7IW86JWIuZH0le28qOiUuZCUqfX0gJXtNfSAl e01NfSAle01GKn0gJXtNR30gJXtNUH0gJXtNUSp9ICV7TVQqfSAleyFFOiV7IU06JXshTU06JXtN RHxNTUQ6JXtvKjotTVEgJSp9fX19fSAle3JlbWFwfSAle2czO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phLm91dH0gfX19fX0KCg==

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to djgpp@delorie.com] on Wed Jan 25 21:22:13 2023
    On 2023-01-25 20:25, Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com] wrote:
    On 1/25/23, Andris Pavenis (andris.pavenis@iki.fi) [via
    djgpp@delorie.com] <djgpp@delorie.com> wrote:
    On 1/23/23 20:06, J.W. Jagersma (jwjagersma@gmail.com) [via
    djgpp@delorie.com] wrote:
    On 2023-01-23 05:00, Ozkan Sezer (sezeroz@gmail.com) [via
    djgpp@delorie.com] wrote:
    The thing is, dxe3gen invokes ld, not gcc. gcc is a front-end to ld
    and handles any such ugliness behind the scene and doing the same for
    dxe3gen might be a real pain.
    I think the tricky part is to prevent gcc from invoking stubify on the
    resulting object file. Otherwise, it doesn't look too difficult. Just
    replace
    param sequences such as "-T" "dxe.ld" with "-Wl,-T,dxe.ld". The same can >>> be
    done for DXE_AS.
    It is should be easy:

    1) dump GCC specs (gcc -dumpspecs >some_file

    2) delete next line after line containing '*post_link:'

    3) use that file in -T option


    Andris

    No '*post_link:' in my gcc's dumpspecs (gcc-3.4.6, cross- from linux.)

    I think Andris added the post_link step somewhere in 4.x, earlier versions do not call stubify. So that doesn't require any special code.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to J.W. Jagersma on Thu Jan 26 03:24:19 2023
    On 2023-01-25 21:22, J.W. Jagersma wrote:
    On 2023-01-25 20:25, Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com] wrote:
    On 1/25/23, Andris Pavenis (andris.pavenis@iki.fi) [via
    djgpp@delorie.com] <djgpp@delorie.com> wrote:
    On 1/23/23 20:06, J.W. Jagersma (jwjagersma@gmail.com) [via
    djgpp@delorie.com] wrote:
    On 2023-01-23 05:00, Ozkan Sezer (sezeroz@gmail.com) [via
    djgpp@delorie.com] wrote:
    The thing is, dxe3gen invokes ld, not gcc. gcc is a front-end to ld >>>>> and handles any such ugliness behind the scene and doing the same for >>>>> dxe3gen might be a real pain.
    I think the tricky part is to prevent gcc from invoking stubify on the >>>> resulting object file. Otherwise, it doesn't look too difficult. Just >>>> replace
    param sequences such as "-T" "dxe.ld" with "-Wl,-T,dxe.ld". The same can >>>> be
    done for DXE_AS.
    It is should be easy:

    1) dump GCC specs (gcc -dumpspecs >some_file

    2) delete next line after line containing '*post_link:'

    3) use that file in -T option


    Andris

    No '*post_link:' in my gcc's dumpspecs (gcc-3.4.6, cross- from linux.)

    I think Andris added the post_link step somewhere in 4.x, earlier versions do not call stubify. So that doesn't require any special code.

    Sorry, that's incorrect, earlier versions *do* call stubify, but via link_command. I thought they used the stub that ld attaches.

    So, if gcc < 4.x must be supported, that does make things more complicated.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to djgpp@delorie.com] on Thu Jan 26 21:50:48 2023
    This is a multi-part message in MIME format.
    On 2023-01-23 05:00, Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com] wrote:
    Just seems wrong to have to copy
    important libs like that?
    That's a shortcoming of dxe3gen with gcc-provided libraries,
    needs to be addressed but no one cared (or no one reported
    the issue probably.)

    Any possibility of you being able to generate a patch or can we get
    it into documentation?

    The thing is, dxe3gen invokes ld, not gcc. gcc is a front-end to ld
    and handles any such ugliness behind the scene and doing the same for
    dxe3gen might be a real pain.

    If someone other than me can generate solution for this, or at least
    some documentation, it'd be nice.

    Seems stubify does not delete/overwrite the input file if the file extension
    is something other than .exe, so calling stubify isn't so disastrous.

    I have a preliminary patch, attached, untested.

    ZGlmZiAtLWdpdCBhL3NyYy9keGUvZHhlM2dlbi5jIGIvc3JjL2R4ZS9keGUzZ2VuLmMKaW5k ZXggYTYxZDFhMWUuLmE0ZjliMmEyIDEwMDY0NAotLS0gYS9zcmM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ci0gICAgICAgIG5ld19hcmd2W25l d19hcmdjKytdID0gYXJndltpXTsKICAgICAgICAgaWYgKGRvdCkKICAgICAgICAgewogICAg ICAgICAgIGlmICghc3RyY2FzZWNtcChkb3QsICIubyIpIHx8ICFzdHJjYXNlY21wKGRvdCwg Ii5hIikpCiAgICAgICAgICAgICBvcHQub2JqY291bnQrKzsKICAgICAgICAgICBlbHNlIGlm ICghc3RyY2FzZWNtcChkb3QsICIuZHhlIikgfHwgIXN0cmNhc2VjbXAoZG90LCAiLnNvIikp CiAgICAgICAgICAgICBvcHQuZHhlZmlsZSA9IGFyZ3ZbaV07CisgICAgICAgICAgbmV3X2Fy Z3ZbbmV3X2FyZ2MrK10gPSBhcmd2W2ldOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAg ICAgICAgeworICAgICAgICAgIGNoYXIgKmFyZyA9IChjaGFyICopbWFsbG9jKHN0cmxlbihh cmd2W2ldKSArIDVVKTsKKyAgICAgICAgICBzcHJpbnRmKGFyZywgIi1XbCwlcyIsIGFyZ3Zb aV0pOworICAgICAgICAgIG5ld19hcmd2W25ld19hcmdjKytdID0gYXJnOwogICAgICAgICB9 CiAgICAgICB9CiAgICAgfQpAQCAtMTQ3Niw3ICsxNDM0LDcgQEAgc3RhdGljIGludCBtYWtl X2ltcGxpYih2b2lkKQogICBhdGV4aXQoZXhpdF9jbGVhbnVwKTsKIAogICAvKiBBbGxyaWdo dCwgbm93IHJ1biB0aGUgYXNzZW1ibGVyIG9uIHRoZSByZXN1bHRpbmcgZmlsZSAqLwotICBz cHJpbnRmKGNtZGJ1ZiwgIiVzIC1vICVzICVzIiwgZHhlX2FzLCBURU1QX09fRklMRSwgVEVN UF9TX0ZJTEUpOworICBzcHJpbnRmKGNtZGJ1ZiwgIiVzIC1jIC1vICVzICVzIiwgZHhlX2Nj LCBURU1QX09fRklMRSwgVEVNUF9TX0ZJTEUpOwogICBpZiAoKHJ2ID0gc3lzdGVtKGNtZGJ1 ZikpICE9IDApCiAgIH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lm8gYmluMmguZXhlCiBmaW5pNS5oOiBmaW5pNS5vIGJpbjJoLmV4ZQogCiBk eGUzZ2VuOiBkeGUzZ2VuLmMgaW5pdDEuaCBpbml0Mi5oIGluaXQzLmggaW5pdDQuaCBpbml0 NS5oIGZpbmkxLmggZmluaTIuaCBmaW5pMy5oIGZpbmk0LmggZmluaTUuaAotCSQoQ0MpIC1P MiAtV2FsbCAtRERYRV9MRD1cIiQoQ1JPU1NfTEQpXCIgLUREWEVfQ0M9XCIkKENST1NTX0ND KVwiIC1ERFhFX0FSPVwiJChDUk9TU19BUilcIiAtRERYRV9BUz1cIiQoQ1JPU1NfQVMpXCIg ZHhlM2dlbi5jIC1vICRACisJJChDQykgLU8yIC1XYWxsIC1ERFhFX0NDPVwiJChDUk9TU19D QylcIiAtRERYRV9BUj1cIiQoQ1JPU1NfQVIpXCIgZHhlM2dlbi5jIC1vICRACiAKIGR4ZWdl bjogZHhlM2dlbgogCWxuIC1zIGR4ZTNnZW4gZHhlZ2VuCg==

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to djgpp@delorie.com] on Fri Jan 27 01:42:01 2023
    On 1/26/23, J.W. Jagersma (jwjagersma@gmail.com) [via
    djgpp@delorie.com] <djgpp@delorie.com> wrote:
    On 2023-01-23 05:00, Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com] wrote:
    Just seems wrong to have to copy
    important libs like that?
    That's a shortcoming of dxe3gen with gcc-provided libraries,
    needs to be addressed but no one cared (or no one reported
    the issue probably.)

    Any possibility of you being able to generate a patch or can we get
    it into documentation?

    The thing is, dxe3gen invokes ld, not gcc. gcc is a front-end to ld
    and handles any such ugliness behind the scene and doing the same for
    dxe3gen might be a real pain.

    If someone other than me can generate solution for this, or at least
    some documentation, it'd be nice.

    Seems stubify does not delete/overwrite the input file if the file
    extension
    is something other than .exe, so calling stubify isn't so disastrous.

    I have a preliminary patch, attached, untested.


    So, you invoke gcc instead of ld,

    - removal of -X: O-OK, default anyway.
    - removal of -S: Are you really sure?
    - removal of -r: Don't think that it'd work.
    - removal of assembler for import lib
    generation: Don't think that it'd work.

    Just tried the patched binary with a dxe build project, it fails
    as expected:
    /dxe3gen -o sndpci.dxe -E _AU_ -U au.o ac97_def.o dpmi_c.o mdma.o
    pcibios.o sc_cmi.o sc_e1371.o sc_ich.o sc_inthd.o sc_sbl24.o
    sc_sbliv.o sc_sbxfi.o sc_via82.o tim.o udivdi3.o
    dxe_tmp.o: linker output file has more than one section

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to djgpp@delorie.com] on Fri Jan 27 00:50:23 2023
    On 2023-01-26 23:42, Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com] wrote:
    On 1/26/23, J.W. Jagersma (jwjagersma@gmail.com) [via
    djgpp@delorie.com] <djgpp@delorie.com> wrote:
    On 2023-01-23 05:00, Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com] >> wrote:
    Just seems wrong to have to copy
    important libs like that?
    That's a shortcoming of dxe3gen with gcc-provided libraries,
    needs to be addressed but no one cared (or no one reported
    the issue probably.)

    Any possibility of you being able to generate a patch or can we get
    it into documentation?

    The thing is, dxe3gen invokes ld, not gcc. gcc is a front-end to ld
    and handles any such ugliness behind the scene and doing the same for
    dxe3gen might be a real pain.

    If someone other than me can generate solution for this, or at least
    some documentation, it'd be nice.

    Seems stubify does not delete/overwrite the input file if the file
    extension
    is something other than .exe, so calling stubify isn't so disastrous.

    I have a preliminary patch, attached, untested.


    So, you invoke gcc instead of ld,

    - removal of -X: O-OK, default anyway.
    - removal of -S: Are you really sure?
    - removal of -r: Don't think that it'd work.

    Those are in ld_args now (-Wl,-X,-S,-r,-T,dxe.ld), gcc splits it at the commas.

    - removal of assembler for import lib
    generation: Don't think that it'd work.

    The assembler is invoked via dxe_cc (gcc -c) instead.

    Just tried the patched binary with a dxe build project, it fails
    as expected:
    ./dxe3gen -o sndpci.dxe -E _AU_ -U au.o ac97_def.o dpmi_c.o mdma.o
    pcibios.o sc_cmi.o sc_e1371.o sc_ich.o sc_inthd.o sc_sbl24.o
    sc_sbliv.o sc_sbxfi.o sc_via82.o tim.o udivdi3.o
    dxe_tmp.o: linker output file has more than one section

    Getting multiple input sections sounds like some problem with the linker script.
    Do you have an open-source project for me to test on? I'll admit that I've never used DXE libraries before...

    I tried it with a basic hello-world that uses std::vector, and got a long list of unresolved references. But I get the same list with an unpatched dxe3gen. It does make a .dxe file with -U.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Thu Jan 26 20:19:32 2023
    Getting multiple input sections sounds like some problem with the linker script.
    Do you have an open-source project for me to test on? I'll admit that I've never used DXE libraries before...

    Q2DOS is GPL2: https://bitbucket.org/neozeed/q2dos

    Frank

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Fri Jan 27 12:43:55 2023
    - removal of -X: O-OK, default anyway.
    - removal of -S: Are you really sure?
    - removal of -r: Don't think that it'd work.

    Those are in ld_args now (-Wl,-X,-S,-r,-T,dxe.ld), gcc splits it at
    the commas.

    OK, missed that part,

    - removal of assembler for import lib
    generation: Don't think that it'd work.

    The assembler is invoked via dxe_cc (gcc -c) instead.

    OK,

    Getting multiple input sections sounds like some problem with the
    linker script. Do you have an open-source project for me to test on?
    I'll admit that I've never used DXE libraries before...

    Here is a tiny one: http://uhexen2.sourceforge.net/tmp/libau.tar.gz

    cd into src, and adjust Makefile.dj and cross_build.sh scripts as you
    need. If you want to test linking with -lgcc, remove 'udivdi3.o' from
    the objects and add -lgcc

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to djgpp@delorie.com] on Fri Jan 27 18:34:39 2023
    On 2023-01-27 02:19, Frank Sapone (emoaddict15@gmail.com) [via djgpp@delorie.com] wrote:

    Getting multiple input sections sounds like some problem with the linker script.
    Do you have an open-source project for me to test on?  I'll admit that I've >> never used DXE libraries before...

    Q2DOS is GPL2: https://bitbucket.org/neozeed/q2dos

    Frank

    Thanks, tried this too. I had to add -fcommon -Wno-error in all makefiles for gcc 12.2. Then everything builds okay with the patched dxe3gen.

    When I launch the game though I get an unresolved symbol _stpcpy. But the same error happens with an unpatched dxe3gen.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to djgpp@delorie.com] on Fri Jan 27 18:56:02 2023
    On 2023-01-27 18:43, Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com] wrote:
    Getting multiple input sections sounds like some problem with the
    linker script. Do you have an open-source project for me to test on?
    I'll admit that I've never used DXE libraries before...

    Here is a tiny one: http://uhexen2.sourceforge.net/tmp/libau.tar.gz

    cd into src, and adjust Makefile.dj and cross_build.sh scripts as you
    need. If you want to test linking with -lgcc, remove 'udivdi3.o' from
    the objects and add -lgcc

    Thanks. It builds fine for me with the patched dxe3gen, no warnings,
    both with and without -lgcc.

    Well, it does not for me, which _is_ a problem. My toolchain is based on gcc-3.4.6 and binutils-2.26.1.

    If you comment out the line with "remove(TEMP_O_FILE)", then run dxe3gen again, what does "objdump -h dxe_tmp.o" (or -x) show?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to djgpp@delorie.com] on Fri Jan 27 18:30:28 2023
    On 2023-01-27 10:43, Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com] wrote:
    - removal of -X: O-OK, default anyway.
    - removal of -S: Are you really sure?
    - removal of -r: Don't think that it'd work.

    Those are in ld_args now (-Wl,-X,-S,-r,-T,dxe.ld), gcc splits it at
    the commas.

    OK, missed that part,

    - removal of assembler for import lib
    generation: Don't think that it'd work.

    The assembler is invoked via dxe_cc (gcc -c) instead.

    OK,

    Getting multiple input sections sounds like some problem with the
    linker script. Do you have an open-source project for me to test on?
    I'll admit that I've never used DXE libraries before...

    Here is a tiny one: http://uhexen2.sourceforge.net/tmp/libau.tar.gz

    cd into src, and adjust Makefile.dj and cross_build.sh scripts as you
    need. If you want to test linking with -lgcc, remove 'udivdi3.o' from
    the objects and add -lgcc

    Thanks. It builds fine for me with the patched dxe3gen, no warnings, both with and without -lgcc.

    $ ~/djgpp-cvs/src/dxe/dxe3gen --show-exp sndpci.dxe
    _AU_close
    _AU_writedata
    _AU_start
    _AU_stop
    _AU_setrate
    _AU_getinfo
    _AU_setmixer_all
    _AU_cardbuf_space
    _AU_search

    $ ~/djgpp-cvs/src/dxe/dxe3gen --show-unres sndpci.dxe
    _sprintf
    _free
    ___djgpp_nearptr_enable
    _clock
    _int86
    ___djgpp_base_address
    _calloc
    _disable
    _enable

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Fri Jan 27 20:43:21 2023
    Getting multiple input sections sounds like some problem with the
    linker script. Do you have an open-source project for me to test on?
    I'll admit that I've never used DXE libraries before...

    Here is a tiny one: http://uhexen2.sourceforge.net/tmp/libau.tar.gz

    cd into src, and adjust Makefile.dj and cross_build.sh scripts as you
    need. If you want to test linking with -lgcc, remove 'udivdi3.o' from
    the objects and add -lgcc

    Thanks. It builds fine for me with the patched dxe3gen, no warnings,
    both with and without -lgcc.

    Well, it does not for me, which _is_ a problem. My toolchain is based on gcc-3.4.6 and binutils-2.26.1.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to Ozkan Sezer on Fri Jan 27 21:20:36 2023
    On 1/27/23, Ozkan Sezer <sezeroz@gmail.com> wrote:
    Thanks. It builds fine for me with the patched dxe3gen, no warnings,
    both with and without -lgcc.

    Well, it does not for me, which _is_ a problem. My toolchain is based on >>> gcc-3.4.6 and binutils-2.26.1.

    If you comment out the line with "remove(TEMP_O_FILE)", then run
    dxe3gen again, what does "objdump -h dxe_tmp.o" (or -x) show?

    Here you go:
    h0.txt and x0.txt are outputs of -h and -x before the patch.
    h1.txt and x1.txt are outputs of -h and -x after the patch.

    And, `file` command reports differently for the two versions:

    dxe_tmp-0.o: Intel 80386 COFF object file, no line number info, not
    stripped, 1 section, symbol offset=0xc104, 433 symbols, 1st section
    name ".text"

    dxe_tmp-1.o: Intel 80386 COFF executable, no line number info, not
    stripped, 3 sections, symbol offset=0xc548, 437 symbols, optional
    header size 28

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From DJ Delorie@21:1/5 to djgpp@delorie.com on Fri Jan 27 14:43:06 2023
    "Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com]"
    <djgpp@delorie.com> writes:
    Yes, this one does work, and yields an identical dxe.

    DJ, Eli: I'd like to apply this patch. Any objections?

    No objections from me.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to DJ Delorie on Fri Jan 27 23:00:28 2023
    Copy: djgpp@delorie.com

    On 1/27/23, DJ Delorie <dj@delorie.com> wrote:
    "Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com]"
    <djgpp@delorie.com> writes:
    Yes, this one does work, and yields an identical dxe.

    DJ, Eli: I'd like to apply this patch. Any objections?

    No objections from me.

    Patch now applied to cvs. Thanks.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to djgpp@delorie.com] on Fri Jan 27 19:32:49 2023
    This is a multi-part message in MIME format.
    On 2023-01-27 19:10, Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com] wrote:
    Thanks. It builds fine for me with the patched dxe3gen, no warnings,
    both with and without -lgcc.

    Well, it does not for me, which _is_ a problem. My toolchain is based on >>> gcc-3.4.6 and binutils-2.26.1.

    If you comment out the line with "remove(TEMP_O_FILE)", then run
    dxe3gen again, what does "objdump -h dxe_tmp.o" (or -x) show?

    Here you go:
    h0.txt and x0.txt are outputs of -h and -x before the patch.
    h1.txt and x1.txt are outputs of -h and -x after the patch.

    Ah, I see now. gcc 3 inserts the wrong linker script.

    From the specs file you posted earlier:

    %{!T*:-Tdjgpp-x.djl} %{T*}

    This means, if no -T option is given, it uses -Tdjgpp-x.djl. Weirdly the -T option is not documented for gcc 3.4.6, that is why I assumed it had to be wrapped via -Wl.

    New patch attached, this should work then.

    ZGlmZiAtLWdpdCBhL3NyYy9keGUvZHhlM2dlbi5jIGIvc3JjL2R4ZS9keGUzZ2VuLmMKaW5k ZXggYTYxZDFhMWUuLjRhMjZiNGUyIDEwMDY0NAotLS0gYS9zcmMvZHhlL2R4ZTNnZW4uYwor KysgYi9zcmMvZHhlL2R4ZTNnZW4uYwpAQCAtMTcwLDE1ICsxNzAsOSBAQAogI2lmbmRlZiBE WEVfQ0MKICNkZWZpbmUgRFhFX0NDICAiZ2NjIgogI2VuZGlmCi0jaWZuZGVmIERYRV9BUwot I2RlZmluZSBEWEVfQVMgICJhcyIKLSNlbmRpZgogI2lmbmRlZiBEWEVfQVIKICNkZWZpbmUg RFhFX0FSICAiYXIiCiAjZW5kaWYKLSNpZm5kZWYgRFhFX0xECi0jZGVmaW5lIERYRV9MRCAg ImxkIgotI2VuZGlmCiAjaWZuZGVmIERYRV9TQwogI2RlZmluZSBEWEVfU0MgICJkeGUubGQi CiAjZW5kaWYKQEAgLTIwNCw3ICsxOTgsNyBAQAogI2RlZmluZSBJU19TTEFTSChwYXRoKSAg ICAgICAgICAoKChwYXRoKSA9PSAnLycpIHx8ICgocGF0aCkgPT0gJ1xcJykpCiAjZGVmaW5l IElTX0RJUl9TRVBBUkFUT1IocGF0aCkgIChJU19TTEFTSChwYXRoKSB8fCAoKHBhdGgpID09 ICc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m ICghc3RyY21wKGJhc2VfbmFtZShhcmd2WzBdKSwgImR4ZWdlbiIpKQogICAgIC8qIGludm9r ZWQgYXMgYGR4ZWdlbicgKi8KQEAgLTU4OCwxMyArNTM2LDE5IEBAIHN0YXRpYyB2b2lkIHBy b2Nlc3NfYXJncyhpbnQgYXJnYywgY2hhciAqYXJndltdLCBjb25zdCBjaGFyICpuZXdfYXJn dltdKQogICAgICAgZWxzZQogICAgICAgewogICAgICAgICBjaGFyICpkb3QgPSBzdHJyY2hy KGFyZ3ZbaV0sICcuJyk7Ci0gICAgICAgIG5ld19hcmd2W25ld19hcmdjKytdID0gYXJndltp XTsKICAgICAgICAgaWYgKGRvdCkKICAgICAgICAgewogICAgICAgICAgIGlmICghc3RyY2Fz ZWNtcChkb3QsICIubyIpIHx8ICFzdHJjYXNlY21wKGRvdCwgIi5hIikpCiAgICAgICAgICAg ICBvcHQub2JqY291bnQrKzsKICAgICAgICAgICBlbHNlIGlmICghc3RyY2FzZWNtcChkb3Qs ICIuZHhlIikgfHwgIXN0cmNhc2VjbXAoZG90LCAiLnNvIikpCiAgICAgICAgICAgICBvcHQu ZHhlZmlsZSA9IGFyZ3ZbaV07CisgICAgICAgICAgbmV3X2FyZ3ZbbmV3X2FyZ2MrK10gPSBh cmd2W2ldOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAg IGNoYXIgKmFyZyA9IChjaGFyICopbWFsbG9jKHN0cmxlbihhcmd2W2ldKSArIDVVKTsKKyAg ICAgICAgICBzcHJpbnRmKGFyZywgIi1XbCwlcyIsIGFyZ3ZbaV0pOworICAgICAgICAgIG5l d19hcmd2W25ld19hcmdjKytdID0gYXJnOwogICAgICAgICB9CiAgICAgICB9CiAgICAgfQpA QCAtMTQ3Niw3ICsxNDMwLDcgQEAgc3RhdGljIGludCBtYWtlX2ltcGxpYih2b2lkKQogICBh dGV4aXQoZXhpdF9jbGVhbnVwKTsKIAogICAvKiBBbGxyaWdodCwgbm93IH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IGhvc3Rz CiAKLUNST1NTX1BSRUZJWD0gaTU4Ni1wYy1tc2Rvc2RqZ3BwLQorQ1JPU1NfUFJFRklYID89 IGk1ODYtcGMtbXNkb3NkamdwcC0KIENST1NTX0NDICAgID0gJChDUk9TU19QUkVGSVgpZ2Nj CiBDUk9TU19BUiAgICA9ICQoQ1JPU1NfUFJFRklYKWFyCiBDUk9TU19BUyAgICA9ICQoQ1JP U1NfUFJFRklYKWFzCkBAIC0zMiw3ICszMiw3IEBAIGZpbmk0Lmg6IGZpbmk0Lm8gYmluMmgu ZXhlCiBmaW5pNS5oOiBmaW5pNS5vIGJpbjJoLmV4ZQogCiBkeGUzZ2VuOiBkeGUzZ2VuLmMg aW5pdDEuaCBpbml0Mi5oIGluaXQzLmggaW5pdDQuaCBpbml0NS5oIGZpbmkxLmggZmluaTIu aCBmaW5pMy5oIGZpbmk0LmggZmluaTUuaAotCSQoQ0MpIC1PMiAtV2FsbCAtRERYRV9MRD1c IiQoQ1JPU1NfTEQpXCIgLUREWEVfQ0M9XCIkKENST1NTX0NDKVwiIC1ERFhFX0FSPVwiJChD Uk9TU19BUilcIiAtRERYRV9BUz1cIiQoQ1JPU1NfQVMpXCIgZHhlM2dlbi5jIC1vICRACisJ JChDQykgLU8yIC1XYWxsIC1ERFhFX0NDPVwiJChDUk9TU19DQylcIiAtRERYRV9BUj1cIiQo Q1JPU1NfQVIpXCIgZHhlM2dlbi5jIC1vICRACiAKIGR4ZWdlbjogZHhlM2dlbgogCWxuIC1z IGR4ZTNnZW4gZHhlZ2VuCg==

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to djgpp@delorie.com] on Fri Jan 27 22:23:40 2023
    On 1/27/23, J.W. Jagersma (jwjagersma@gmail.com) [via
    djgpp@delorie.com] <djgpp@delorie.com> wrote:
    On 2023-01-27 19:10, Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com] wrote:
    Thanks. It builds fine for me with the patched dxe3gen, no warnings, >>>>> both with and without -lgcc.

    Well, it does not for me, which _is_ a problem. My toolchain is based
    on
    gcc-3.4.6 and binutils-2.26.1.

    If you comment out the line with "remove(TEMP_O_FILE)", then run
    dxe3gen again, what does "objdump -h dxe_tmp.o" (or -x) show?

    Here you go:
    h0.txt and x0.txt are outputs of -h and -x before the patch.
    h1.txt and x1.txt are outputs of -h and -x after the patch.

    Ah, I see now. gcc 3 inserts the wrong linker script.

    From the specs file you posted earlier:

    %{!T*:-Tdjgpp-x.djl} %{T*}

    This means, if no -T option is given, it uses -Tdjgpp-x.djl. Weirdly the
    -T
    option is not documented for gcc 3.4.6, that is why I assumed it had to be wrapped via -Wl.

    New patch attached, this should work then.

    Yes, this one does work, and yields an identical dxe.

    DJ, Eli: I'd like to apply this patch. Any objections?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Fri Jan 27 23:46:10 2023
    DJ, Eli: I'd like to apply this patch. Any objections?

    I won't fight its inclusion, but I wonder whether all of the aspects
    of this patch have been considered. I'm worried by the changes in
    behavior this patch brings. At least the following stand out:

    the code will no longer heed DXE_LD_LIBRARY_PATH and DJDIR

    I documented that in the applied patch:

    https://www.delorie.com/bin/cvsweb.cgi/djgpp/src/docs/kb/wc206.txi https://www.delorie.com/bin/cvsweb.cgi/djgpp/src/docs/kb/wc206.txi.diff?r1=1.15&r2=1.16

    makefile.dxe uses "?=", which AFAICT we never used in the DJGPP
    build tree

    I can revert that part: Tell me?

    What if someone wants to use those
    environment variables to tweak the build of a DXE?

    One can simply use -L/some/path -lfoo (verified that it works)

    Also, this comment no longer describes what the code does, after the
    change:

    /* Allright, now run the assembler on the resulting file */
    - sprintf(cmdbuf, "%s -o %s %s", dxe_as, TEMP_O_FILE, TEMP_S_FILE);
    + sprintf(cmdbuf, "%s -c -o %s %s", dxe_cc, TEMP_O_FILE, TEMP_S_FILE);


    Change to something like this??
    /* Allright, now build resulting file */

    If you aren't going to wait for me to answer your questions, why ask
    me?

    I got one response, thought it was enough. Sorry -- will wait
    all next time.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to as I on Sat Jan 28 00:03:33 2023
    . the code will no longer heed DXE_LD_LIBRARY_PATH and DJDIR

    In the vast majority of cases those would point to the global lib
    directory.
    That is no longer necessary, gcc will know where to look.

    In case someone used DXE_LD_LIBRARY_PATH to point to something
    else, that seems like a strange configuration, was that ever intended to
    be supported?

    That one was supposed to let ld know where the library dir is.
    If anyone else actually used it for something else, well, as I said,
    they can always use -L/some/path -lfoo as they always could.

    I also had yet to update the manual for the v2 patch:

    I already updated the changelog, if that's what you mean.

    Also, I suppose the version number should be bumped.

    djgpp-2.05 had version 1.0.3. The cvs 2.0.6 version is now at 1.0.4

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Sat Jan 28 00:36:16 2023
    I meant in dxegen.txi, line 68. It should read:

    DXE_SC: Path to linker script name. If not set, defaults to dxe.ld.
    -Passed internally to the linker, like 'gcc -Wl,-T,dxe.ld'
    +Passed internally to the linker, like 'gcc -T dxe.ld'
    @end example

    I can do that.

    Also, I suppose the version number should be bumped.

    djgpp-2.05 had version 1.0.3. The cvs 2.0.6 version is now at 1.0.4

    But people have been compiling dxe3gen from cvs for a while,

    I wouldn't know about that,

    so they will
    already have a v1.0.4. I think it's a good idea to signal that this
    version is different.

    No objections from me.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to djgpp@delorie.com] on Fri Jan 27 21:53:48 2023
    On 2023-01-27 21:10, Eli Zaretskii (eliz@gnu.org) [via djgpp@delorie.com] wrote:
    From: "Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com]" <djgpp@delorie.com>
    Date: Fri, 27 Jan 2023 22:23:40 +0300

    On 1/27/23, J.W. Jagersma (jwjagersma@gmail.com) [via
    djgpp@delorie.com] <djgpp@delorie.com> wrote:
    On 2023-01-27 19:10, Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com]
    wrote:
    Thanks. It builds fine for me with the patched dxe3gen, no warnings, >>>>>>> both with and without -lgcc.

    Well, it does not for me, which _is_ a problem. My toolchain is based >>>>>> on
    gcc-3.4.6 and binutils-2.26.1.

    If you comment out the line with "remove(TEMP_O_FILE)", then run
    dxe3gen again, what does "objdump -h dxe_tmp.o" (or -x) show?

    Here you go:
    h0.txt and x0.txt are outputs of -h and -x before the patch.
    h1.txt and x1.txt are outputs of -h and -x after the patch.

    Ah, I see now. gcc 3 inserts the wrong linker script.

    From the specs file you posted earlier:

    %{!T*:-Tdjgpp-x.djl} %{T*}

    This means, if no -T option is given, it uses -Tdjgpp-x.djl. Weirdly the >>> -T
    option is not documented for gcc 3.4.6, that is why I assumed it had to be >>> wrapped via -Wl.

    New patch attached, this should work then.

    Yes, this one does work, and yields an identical dxe.

    DJ, Eli: I'd like to apply this patch. Any objections?

    I won't fight its inclusion, but I wonder whether all of the aspects
    of this patch have been considered. I'm worried by the changes in
    behavior this patch brings. At least the following stand out:

    . the code will no longer heed DXE_LD_LIBRARY_PATH and DJDIR

    In the vast majority of cases those would point to the global lib directory. That is no longer necessary, gcc will know where to look.

    In case someone used DXE_LD_LIBRARY_PATH to point to something else, that seems like a strange configuration, was that ever intended to be supported?

    . makefile.dxe uses "?=", which AFAICT we never used in the DJGPP
    build tree

    I wasn't aware that this is modern / non-standard (is it though?). But this makefile is only used for quick cross-compiling without configuring/building the whole source tree, so presumably no old versions of GNU Make will ever see it.

    This change is not directly related to the rest of the patch. But some
    people (me) who use i386-pc-msdosdjgpp might want some method to configure
    the cross-prefix.


    Are these changes justified? What if someone wants to use those
    environment variables to tweak the build of a DXE?

    Also, this comment no longer describes what the code does, after the
    change:

    /* Allright, now run the assembler on the resulting file */
    - sprintf(cmdbuf, "%s -o %s %s", dxe_as, TEMP_O_FILE, TEMP_S_FILE);
    + sprintf(cmdbuf, "%s -c -o %s %s", dxe_cc, TEMP_O_FILE, TEMP_S_FILE);

    It does run the assembler, just indirectly.

    I also had yet to update the manual for the v2 patch:

    DXE_SC: Path to linker script name. If not set, defaults to dxe.ld.
    -Passed internally to ld, like 'ld -T dxe.ld'
    +Passed internally to the linker, like 'gcc -Wl,-T,dxe.ld'
    @end example

    This line is now somewhat inconsistent with the code. Also, I suppose the version number should be bumped.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to djgpp@delorie.com] on Fri Jan 27 22:20:30 2023
    On 2023-01-27 22:03, Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com] wrote:
    . the code will no longer heed DXE_LD_LIBRARY_PATH and DJDIR

    In the vast majority of cases those would point to the global lib
    directory.
    That is no longer necessary, gcc will know where to look.

    In case someone used DXE_LD_LIBRARY_PATH to point to something
    else, that seems like a strange configuration, was that ever intended to
    be supported?

    That one was supposed to let ld know where the library dir is.
    If anyone else actually used it for something else, well, as I said,
    they can always use -L/some/path -lfoo as they always could.

    Agree, -L should be used for non-standard dirs.

    I also had yet to update the manual for the v2 patch:

    I already updated the changelog, if that's what you mean.

    I meant in dxegen.txi, line 68. It should read:

    DXE_SC: Path to linker script name. If not set, defaults to dxe.ld.
    -Passed internally to the linker, like 'gcc -Wl,-T,dxe.ld'
    +Passed internally to the linker, like 'gcc -T dxe.ld'
    @end example

    Also, I suppose the version number should be bumped.

    djgpp-2.05 had version 1.0.3. The cvs 2.0.6 version is now at 1.0.4

    But people have been compiling dxe3gen from cvs for a while, so they will already have a v1.0.4. I think it's a good idea to signal that this version is different.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to Ozkan Sezer on Sat Jan 28 00:58:19 2023
    On 1/28/23, Ozkan Sezer <sezeroz@gmail.com> wrote:
    I meant in dxegen.txi, line 68. It should read:

    DXE_SC: Path to linker script name. If not set, defaults to dxe.ld.
    -Passed internally to the linker, like 'gcc -Wl,-T,dxe.ld'
    +Passed internally to the linker, like 'gcc -T dxe.ld'

    One downside of the new version is that it does nıt seem to work with
    gcc2.95 as tested under dosbox -- the -T dxe.ld switches doesn't seem
    to work and it spits the same multiple sections error.

    Don't know whether we actually expect dxe3gen to work with gcc2.95 is
    another matter: Should we care?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Fri Jan 27 22:24:27 2023
    Copy: dj@delorie.com

    From: "Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com]" <djgpp@delorie.com>
    Date: Fri, 27 Jan 2023 23:00:28 +0300
    Cc: djgpp@delorie.com

    On 1/27/23, DJ Delorie <dj@delorie.com> wrote:
    "Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com]" <djgpp@delorie.com> writes:
    Yes, this one does work, and yields an identical dxe.

    DJ, Eli: I'd like to apply this patch. Any objections?

    No objections from me.

    Patch now applied to cvs. Thanks.

    If you aren't going to wait for me to answer your questions, why ask
    me?

    As it happens, when I saw the question, I actually read the patch,
    thought about it, and posted a non-trivial response. I'd hope that
    the effort I made will not be wasted.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to Ozkan Sezer on Sat Jan 28 01:11:37 2023
    On 1/28/23, Ozkan Sezer <sezeroz@gmail.com> wrote:
    On 1/28/23, Ozkan Sezer <sezeroz@gmail.com> wrote:
    I meant in dxegen.txi, line 68. It should read:

    DXE_SC: Path to linker script name. If not set, defaults to dxe.ld.
    -Passed internally to the linker, like 'gcc -Wl,-T,dxe.ld'
    +Passed internally to the linker, like 'gcc -T dxe.ld'

    One downside of the new version is that it does nıt seem to work with gcc2.95 as tested under dosbox -- the -T dxe.ld switches doesn't seem
    to work and it spits the same multiple sections error.

    Don't know whether we actually expect dxe3gen to work with gcc2.95 is
    another matter: Should we care?

    I am also curious about since which version -T script is honored on
    the gcc command line.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Fri Jan 27 22:10:34 2023
    From: "Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com]" <djgpp@delorie.com>
    Date: Fri, 27 Jan 2023 22:23:40 +0300

    On 1/27/23, J.W. Jagersma (jwjagersma@gmail.com) [via
    djgpp@delorie.com] <djgpp@delorie.com> wrote:
    On 2023-01-27 19:10, Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com]
    wrote:
    Thanks. It builds fine for me with the patched dxe3gen, no warnings, >>>>> both with and without -lgcc.

    Well, it does not for me, which _is_ a problem. My toolchain is based >>>> on
    gcc-3.4.6 and binutils-2.26.1.

    If you comment out the line with "remove(TEMP_O_FILE)", then run
    dxe3gen again, what does "objdump -h dxe_tmp.o" (or -x) show?

    Here you go:
    h0.txt and x0.txt are outputs of -h and -x before the patch.
    h1.txt and x1.txt are outputs of -h and -x after the patch.

    Ah, I see now. gcc 3 inserts the wrong linker script.

    From the specs file you posted earlier:

    %{!T*:-Tdjgpp-x.djl} %{T*}

    This means, if no -T option is given, it uses -Tdjgpp-x.djl. Weirdly the -T
    option is not documented for gcc 3.4.6, that is why I assumed it had to be wrapped via -Wl.

    New patch attached, this should work then.

    Yes, this one does work, and yields an identical dxe.

    DJ, Eli: I'd like to apply this patch. Any objections?

    I won't fight its inclusion, but I wonder whether all of the aspects
    of this patch have been considered. I'm worried by the changes in
    behavior this patch brings. At least the following stand out:

    . the code will no longer heed DXE_LD_LIBRARY_PATH and DJDIR
    . makefile.dxe uses "?=", which AFAICT we never used in the DJGPP
    build tree

    Are these changes justified? What if someone wants to use those
    environment variables to tweak the build of a DXE?

    Also, this comment no longer describes what the code does, after the
    change:

    /* Allright, now run the assembler on the resulting file */
    - sprintf(cmdbuf, "%s -o %s %s", dxe_as, TEMP_O_FILE, TEMP_S_FILE);
    + sprintf(cmdbuf, "%s -c -o %s %s", dxe_cc, TEMP_O_FILE, TEMP_S_FILE);

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Sat Jan 28 09:29:25 2023
    Date: Fri, 27 Jan 2023 21:53:48 +0100
    From: "J.W. Jagersma (jwjagersma@gmail.com) [via djgpp@delorie.com]" <djgpp@delorie.com>

    . the code will no longer heed DXE_LD_LIBRARY_PATH and DJDIR

    In the vast majority of cases those would point to the global lib directory. That is no longer necessary, gcc will know where to look.

    In case someone used DXE_LD_LIBRARY_PATH to point to something else, that seems
    like a strange configuration, was that ever intended to be supported?

    I don't know. DJGPP is a very old project, and it is sometimes used
    in strange and tricky configurations for perhaps unorthodox purposes.
    By removing these variables we could inadvertently break someone's
    project in some rare cases. Why do that if we could instead keep the
    old behavior intact?

    IOW, given the age of DJGPP, we should strive not to make breaking
    changes unless we have a very good reason to do so.

    . makefile.dxe uses "?=", which AFAICT we never used in the DJGPP
    build tree

    I wasn't aware that this is modern / non-standard (is it though?). But this makefile is only used for quick cross-compiling without configuring/building the whole source tree, so presumably no old versions of GNU Make will ever see
    it.

    This change is not directly related to the rest of the patch. But some people (me) who use i386-pc-msdosdjgpp might want some method to configure the cross-prefix.

    Why is ?= needed here, and a simple = is not enough?

    Also, this comment no longer describes what the code does, after the change:

    /* Allright, now run the assembler on the resulting file */
    - sprintf(cmdbuf, "%s -o %s %s", dxe_as, TEMP_O_FILE, TEMP_S_FILE);
    + sprintf(cmdbuf, "%s -c -o %s %s", dxe_cc, TEMP_O_FILE, TEMP_S_FILE);

    It does run the assembler, just indirectly.

    Running "gcc -c -o" is hardly described accurately as "running the
    assembler". If we want to go to that level, then the comment should
    say something like "run the driver, the compiler, and the assembler"
    (not that I think we should say that).

    I also had yet to update the manual for the v2 patch:

    DXE_SC: Path to linker script name. If not set, defaults to dxe.ld. -Passed internally to ld, like 'ld -T dxe.ld'
    +Passed internally to the linker, like 'gcc -Wl,-T,dxe.ld'
    @end example

    This line is now somewhat inconsistent with the code. Also, I suppose the version number should be bumped.

    Agreed.

    Thanks.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Sat Jan 28 09:41:01 2023
    From: "Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com]" <djgpp@delorie.com>
    Date: Sat, 28 Jan 2023 00:58:19 +0300

    One downside of the new version is that it does nıt seem to work with gcc2.95 as tested under dosbox -- the -T dxe.ld switches doesn't seem
    to work and it spits the same multiple sections error.

    Don't know whether we actually expect dxe3gen to work with gcc2.95 is
    another matter: Should we care?

    Do we understand why it doesn't work with GCC 2.95? If so, can you
    explain the reasons?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Sat Jan 28 09:36:29 2023
    From: "Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com]" <djgpp@delorie.com>
    Date: Sat, 28 Jan 2023 00:03:33 +0300

    . the code will no longer heed DXE_LD_LIBRARY_PATH and DJDIR

    In the vast majority of cases those would point to the global lib directory.
    That is no longer necessary, gcc will know where to look.

    In case someone used DXE_LD_LIBRARY_PATH to point to something
    else, that seems like a strange configuration, was that ever intended to
    be supported?

    That one was supposed to let ld know where the library dir is.
    If anyone else actually used it for something else, well, as I said,
    they can always use -L/some/path -lfoo as they always could.

    Why cannot we tweak the way we compute the command arguments to still
    honor these two variables? It's a simple matter of reusing code that
    was already there, and was used for ages, no?

    IOW, is there a real reason for removing the code which used the
    values of those two environment variables?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Sat Jan 28 09:20:29 2023
    From: "Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com]" <djgpp@delorie.com>
    Date: Fri, 27 Jan 2023 23:46:10 +0300

    DJ, Eli: I'd like to apply this patch. Any objections?

    I won't fight its inclusion, but I wonder whether all of the aspects
    of this patch have been considered. I'm worried by the changes in
    behavior this patch brings. At least the following stand out:

    the code will no longer heed DXE_LD_LIBRARY_PATH and DJDIR

    I documented that in the applied patch:

    https://www.delorie.com/bin/cvsweb.cgi/djgpp/src/docs/kb/wc206.txi https://www.delorie.com/bin/cvsweb.cgi/djgpp/src/docs/kb/wc206.txi.diff?r1=1.15&r2=1.16

    Instead of documenting, could we keep the previous behavior?

    makefile.dxe uses "?=", which AFAICT we never used in the DJGPP
    build tree

    I can revert that part: Tell me?

    If it is not necessary, I think reverting it would be best. "?=" was introduced in GNU Make 3.77, but someone might be using an older
    version. If the functionality of "?=" is really needed here, we could
    instead use its equivalent

    ifeq ($(origin FOO), undefined)
    FOO = bar
    endif

    What if someone wants to use those
    environment variables to tweak the build of a DXE?

    One can simply use -L/some/path -lfoo (verified that it works)

    OK, but can we actually still honor those variables in the new code,
    so that if someone does use them, they could still use their scripts
    and build procedures?

    Also, this comment no longer describes what the code does, after the change:

    /* Allright, now run the assembler on the resulting file */
    - sprintf(cmdbuf, "%s -o %s %s", dxe_as, TEMP_O_FILE, TEMP_S_FILE);
    + sprintf(cmdbuf, "%s -c -o %s %s", dxe_cc, TEMP_O_FILE, TEMP_S_FILE);


    Change to something like this??
    /* Allright, now build resulting file */

    Something like this. If it's important to state which programs are
    run, I would say

    /* Allright, now run the compiler to produce object and assembly files */

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Sat Jan 28 10:55:47 2023
    makefile.dxe uses "?=", which AFAICT we never used in the DJGPP
    build tree

    I can revert that part: Tell me?

    If it is not necessary, I think reverting it would be best.

    Sure, I can do that.

    the code will no longer heed DXE_LD_LIBRARY_PATH and DJDIR

    I documented that in the applied patch:

    https://www.delorie.com/bin/cvsweb.cgi/djgpp/src/docs/kb/wc206.txi
    https://www.delorie.com/bin/cvsweb.cgi/djgpp/src/docs/kb/wc206.txi.diff?r1=1.15&r2=1.16

    Instead of documenting, could we keep the previous behavior?
    [...]
    One can simply use -L/some/path -lfoo (verified that it works)

    OK, but can we actually still honor those variables in the new code,
    so that if someone does use them, they could still use their scripts
    and build procedures?
    [...]
    I don't know. DJGPP is a very old project, and it is sometimes used
    in strange and tricky configurations for perhaps unorthodox purposes.
    By removing these variables we could inadvertently break someone's
    project in some rare cases. Why do that if we could instead keep the
    old behavior intact?

    You mean, even if it won't be used, compute the libdir from either DXE_LD_LIBRARY_PATH or DJDIR and add it as -L ?

    Change to something like this??
    /* Allright, now build resulting file */

    Something like this. If it's important to state which programs are
    run, I would say

    /* Allright, now run the compiler to produce object and assembly files */

    OK, can do.

    "?=" was
    introduced in GNU Make 3.77, but someone might be using an older
    version.
    [...]
    I don't know. DJGPP is a very old project, and it is sometimes used
    in strange and tricky configurations for perhaps unorthodox purposes.

    With those in mind, what do you think about compatibility with old
    gcc versions? I found that at least gcc-2.95 doesn't work after this
    patch possibly because it doesn't handle -T dxe.ld on the command
    line. (I only tested gcc-3.4.6, maybe older ones don't work either.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Sat Jan 28 11:07:07 2023
    One downside of the new version is that it does nıt seem to work with
    gcc2.95 as tested under dosbox -- the -T dxe.ld switches doesn't seem
    to work and it spits the same multiple sections error.

    Don't know whether we actually expect dxe3gen to work with gcc2.95 is
    another matter: Should we care?

    Do we understand why it doesn't work with GCC 2.95? If so, can you
    explain the reasons?

    As I understand it (someone correct me if I'm wrong), it ignores the
    -T dxe.ld switches on its command line.

    This can be a show stopper, so I _can_ revert the whole patch: The
    patch was made for the whole purpose of dxe3gen finding -lgcc (and
    -lstdc++) automatically in the first place, and one can just do the
    manual labor of copying them to $(DJDIR)/lib easily (a documentation
    about it from someone would be nice.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Sat Jan 28 12:08:42 2023
    You mean, even if it won't be used, compute the libdir from either
    DXE_LD_LIBRARY_PATH or DJDIR and add it as -L ?

    AFAIK, DJDIR is always set in DJGPP.

    Not in cross- environments, but I hear you,

    The original code used
    DXE_LD_LIBRARY_PATH if it was defined, else fell back to DJDIR. I
    think either keeping that, or maybe adding one more fallback, for when neither DXE_LD_LIBRARY_PATH nor DJDIR is define, would be a backward-compatible change.

    OK, can compute a libdir from those env vars and add as -Lxxx

    I don't know. DJGPP is a very old project, and it is sometimes used
    in strange and tricky configurations for perhaps unorthodox purposes.

    With those in mind, what do you think about compatibility with old
    gcc versions? I found that at least gcc-2.95 doesn't work after this
    patch possibly because it doesn't handle -T dxe.ld on the command
    line.

    I thought you said that if actually invoked from the shell prompt, it
    did handle "-T dxe.ld"?

    If that is not true, can we use -Xlinker or -Wl instead, so as to
    communicate this option directly to the linker?

    I tried doing the following, and it doesn't work even with my gcc-3.4.6
    Am I doing something wrong?

    Index: dxe3gen.c ===================================================================
    RCS file: /cvs/djgpp/djgpp/src/dxe/dxe3gen.c,v
    retrieving revision 1.26
    diff -u -p -r1.26 dxe3gen.c
    --- dxe3gen.c 27 Jan 2023 20:00:04 -0000 1.26
    +++ dxe3gen.c 28 Jan 2023 09:04:57 -0000
    @@ -198,7 +198,7 @@
    #define IS_SLASH(path) (((path) == '/') || ((path) == '\\'))
    #define IS_DIR_SEPARATOR(path) (IS_SLASH(path) || ((path) == ':'))

    -#define NUMBER_OF_LINKER_ARGS 7
    +#define NUMBER_OF_LINKER_ARGS 9
    #define NUMBER_OF_ADDITIONAL_LOADED_LIBS 0

    #define IS_VALID_CIE(id) ((id) == 0)
    @@ -438,8 +438,10 @@ static void process_args(int argc, char
    new_argv[2] = "-Wl,-X,-S,-r";
    new_argv[3] = "-o";
    new_argv[4] = TEMP_O_FILE;
    - new_argv[5] = "-T";
    - new_argv[6] = dxe_sc;
    + new_argv[5] = "-Xlinker";
    + new_argv[6] = "-T";
    + new_argv[7] = "-Xlinker";
    + new_argv[8] = dxe_sc;

    if (!strcmp(base_name(argv[0]), "dxegen"))

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Sat Jan 28 10:54:35 2023
    From: "Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com]" <djgpp@delorie.com>
    Date: Sat, 28 Jan 2023 10:55:47 +0300

    makefile.dxe uses "?=", which AFAICT we never used in the DJGPP
    build tree

    I can revert that part: Tell me?

    If it is not necessary, I think reverting it would be best.

    Sure, I can do that.

    Thanks.

    the code will no longer heed DXE_LD_LIBRARY_PATH and DJDIR

    I documented that in the applied patch:

    https://www.delorie.com/bin/cvsweb.cgi/djgpp/src/docs/kb/wc206.txi
    https://www.delorie.com/bin/cvsweb.cgi/djgpp/src/docs/kb/wc206.txi.diff?r1=1.15&r2=1.16

    Instead of documenting, could we keep the previous behavior?
    [...]
    One can simply use -L/some/path -lfoo (verified that it works)

    OK, but can we actually still honor those variables in the new code,
    so that if someone does use them, they could still use their scripts
    and build procedures?
    [...]
    I don't know. DJGPP is a very old project, and it is sometimes used
    in strange and tricky configurations for perhaps unorthodox purposes.
    By removing these variables we could inadvertently break someone's
    project in some rare cases. Why do that if we could instead keep the
    old behavior intact?

    You mean, even if it won't be used, compute the libdir from either DXE_LD_LIBRARY_PATH or DJDIR and add it as -L ?

    AFAIK, DJDIR is always set in DJGPP. The original code used DXE_LD_LIBRARY_PATH if it was defined, else fell back to DJDIR. I
    think either keeping that, or maybe adding one more fallback, for when
    neither DXE_LD_LIBRARY_PATH nor DJDIR is define, would be a
    backward-compatible change.

    I don't know. DJGPP is a very old project, and it is sometimes used
    in strange and tricky configurations for perhaps unorthodox purposes.

    With those in mind, what do you think about compatibility with old
    gcc versions? I found that at least gcc-2.95 doesn't work after this
    patch possibly because it doesn't handle -T dxe.ld on the command
    line.

    I thought you said that if actually invoked from the shell prompt, it
    did handle "-T dxe.ld"?

    If that is not true, can we use -Xlinker or -Wl instead, so as to
    communicate this option directly to the linker?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to djgpp@delorie.com on Sat Jan 28 12:48:06 2023
    On 1/28/23, Eli Zaretskii (eliz@gnu.org) [via djgpp@delorie.com] <djgpp@delorie.com> wrote:
    From: "Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com]"
    <djgpp@delorie.com>
    Date: Sat, 28 Jan 2023 12:08:42 +0300

    If that is not true, can we use -Xlinker or -Wl instead, so as to
    communicate this option directly to the linker?

    I tried doing the following, and it doesn't work even with my gcc-3.4.6
    Am I doing something wrong?

    I don't know. If you use this and add -v to the switches, what does
    GCC show for the ld command it invokes, and how is that different from
    the original code, where -T is supplied on the GCC command line?

    Before:

    Reading specs from /usr/local/cross-djgpp/lib/gcc/i586-pc-msdosdjgpp/3.4.6/specs
    Configured with: ../gcc-3.46/configure --prefix=/usr/local/cross-djgpp --target=i586-pc-msdosdjgpp --with-headers=/usr/local/cross-djgpp/i586-pc-msdosdjgpp/include --enable-languages=c,c++ --disable-libgcj --disable-libada
    --disable-nls
    Thread model: single
    gcc version 3.4.6
    /usr/local/cross-djgpp/libexec/gcc/i586-pc-msdosdjgpp/3.4.6/collect2
    -o dxe_tmp.o -L/usr/local/cross-djgpp/lib/gcc/i586-pc-msdosdjgpp/3.4.6 -L/usr/local/cross-djgpp/lib/gcc/i586-pc-msdosdjgpp/3.4.6/../../../../i586-pc-msdosdjgpp/lib
    -X -S -r au.o ac97_def.o dpmi_c.o mdma.o pcibios.o sc_cmi.o sc_e1371.o
    sc_ich.o sc_inthd.o sc_sbl24.o sc_sbliv.o sc_sbxfi.o sc_via82.o tim.o
    udivdi3.o -T dxe.ld
    /usr/local/cross-djgpp/lib/gcc/i586-pc-msdosdjgpp/3.4.6/../../../../i586-pc-msdosdjgpp/bin/stubify
    -v dxe_tmp.o
    stubify for djgpp V2.X executables, Copyright (C) 1995-2003 DJ Delorie
    stubify: dxe_tmp.o -> dxe_tmp.exe


    After:

    Reading specs from /usr/local/cross-djgpp/lib/gcc/i586-pc-msdosdjgpp/3.4.6/specs
    Configured with: ../gcc-3.46/configure --prefix=/usr/local/cross-djgpp --target=i586-pc-msdosdjgpp --with-headers=/usr/local/cross-djgpp/i586-pc-msdosdjgpp/include --enable-languages=c,c++ --disable-libgcj --disable-libada
    --disable-nls
    Thread model: single
    gcc version 3.4.6
    /usr/local/cross-djgpp/libexec/gcc/i586-pc-msdosdjgpp/3.4.6/collect2
    -o dxe_tmp.o -L/usr/local/cross-djgpp/lib/gcc/i586-pc-msdosdjgpp/3.4.6 -L/usr/local/cross-djgpp/lib/gcc/i586-pc-msdosdjgpp/3.4.6/../../../../i586-pc-msdosdjgpp/lib
    -X -S -r -T dxe.ld au.o ac97_def.o dpmi_c.o mdma.o pcibios.o sc_cmi.o sc_e1371.o sc_ich.o sc_inthd.o sc_sbl24.o sc_sbliv.o sc_sbxfi.o
    sc_via82.o tim.o udivdi3.o -Tdjgpp-x.djl
    /usr/local/cross-djgpp/lib/gcc/i586-pc-msdosdjgpp/3.4.6/../../../../i586-pc-msdosdjgpp/bin/stubify
    -v dxe_tmp.o
    stubify for djgpp V2.X executables, Copyright (C) 1995-2003 DJ Delorie
    stubify: dxe_tmp.o -> dxe_tmp.exe
    dxe_tmp.o: linker output file has more than one section


    Note that additional "-Tdjgpp-x.djl" at the end which screws up everything.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to djgpp@delorie.com on Sat Jan 28 12:12:50 2023
    On 1/28/23, Eli Zaretskii (eliz@gnu.org) [via djgpp@delorie.com] <djgpp@delorie.com> wrote:
    From: "Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com]"
    <djgpp@delorie.com>
    Date: Sat, 28 Jan 2023 11:07:07 +0300

    This can be a show stopper, so I _can_ revert the whole patch: The
    patch was made for the whole purpose of dxe3gen finding -lgcc (and
    -lstdc++) automatically in the first place, and one can just do the
    manual labor of copying them to $(DJDIR)/lib easily (a documentation
    about it from someone would be nice.)

    Having "-L$(DJDIR)/lib" and using GCC to find the standard libraries
    are not contradicting goals, are they? The -L switch just says "look
    in that directory as well", it doesn't replace the standard
    directories.

    Well, try doing the following horrible -L : -L/usr/local/cross-djgpp/lib/gcc/i586-pc-msdosdjgpp/3.4.6

    because, unlike libc.a, libgcc.a isn't under $(DJDIR)/lib
    at least not in cross- environments -- really do not know
    about a native installation. That was the original issue.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to djgpp@delorie.com on Sat Jan 28 12:51:21 2023
    On 1/28/23, Eli Zaretskii (eliz@gnu.org) [via djgpp@delorie.com] <djgpp@delorie.com> wrote:
    From: "Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com]"
    <djgpp@delorie.com>
    Date: Sat, 28 Jan 2023 12:12:50 +0300

    On 1/28/23, Eli Zaretskii (eliz@gnu.org) [via djgpp@delorie.com]
    <djgpp@delorie.com> wrote:
    From: "Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com]"
    <djgpp@delorie.com>
    Date: Sat, 28 Jan 2023 11:07:07 +0300

    This can be a show stopper, so I _can_ revert the whole patch: The
    patch was made for the whole purpose of dxe3gen finding -lgcc (and
    -lstdc++) automatically in the first place, and one can just do the
    manual labor of copying them to $(DJDIR)/lib easily (a documentation
    about it from someone would be nice.)

    Having "-L$(DJDIR)/lib" and using GCC to find the standard libraries
    are not contradicting goals, are they? The -L switch just says "look
    in that directory as well", it doesn't replace the standard
    directories.

    Well, try doing the following horrible -L :
    -L/usr/local/cross-djgpp/lib/gcc/i586-pc-msdosdjgpp/3.4.6

    because, unlike libc.a, libgcc.a isn't under $(DJDIR)/lib
    at least not in cross- environments -- really do not know
    about a native installation. That was the original issue.

    OK, but still: there should be no problem with having both on the
    command line, right?

    No, no problems. But detecting and correctly using -lgcc was the
    original goal.

    Looks like this is becoming a hassle. Revert the patch and document
    the -lgcc issue instead? (Even though I did like the result of the
    patch where it does run..)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Sat Jan 28 12:43:05 2023
    From: "Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com]" <djgpp@delorie.com>
    Date: Sat, 28 Jan 2023 12:48:06 +0300

    /usr/local/cross-djgpp/libexec/gcc/i586-pc-msdosdjgpp/3.4.6/collect2
    -o dxe_tmp.o -L/usr/local/cross-djgpp/lib/gcc/i586-pc-msdosdjgpp/3.4.6 -L/usr/local/cross-djgpp/lib/gcc/i586-pc-msdosdjgpp/3.4.6/../../../../i586-pc-msdosdjgpp/lib
    -X -S -r -T dxe.ld au.o ac97_def.o dpmi_c.o mdma.o pcibios.o sc_cmi.o sc_e1371.o sc_ich.o sc_inthd.o sc_sbl24.o sc_sbliv.o sc_sbxfi.o
    sc_via82.o tim.o udivdi3.o -Tdjgpp-x.djl
    /usr/local/cross-djgpp/lib/gcc/i586-pc-msdosdjgpp/3.4.6/../../../../i586-pc-msdosdjgpp/bin/stubify
    -v dxe_tmp.o
    stubify for djgpp V2.X executables, Copyright (C) 1995-2003 DJ Delorie stubify: dxe_tmp.o -> dxe_tmp.exe
    dxe_tmp.o: linker output file has more than one section


    Note that additional "-Tdjgpp-x.djl" at the end which screws up everything.

    What if you use both -T and -Xlinker -T? IOW, pass -T both to GCC and
    to the linker directly?

    If this still doesn't work, can you show the output of "gcc -dumpspecs"
    from GCC 2.95?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Sat Jan 28 14:28:17 2023
    Note that additional "-Tdjgpp-x.djl" at the end which screws up everything.

    What if you use both -T and -Xlinker -T? IOW, pass -T both to GCC and
    to the linker directly?

    That works with gcc-3.4.6, but not with gcc-2.95: adding -v to command line shows that gcc295 invokes ld with -Tdjgpp.djl -T dxe.ld

    If this still doesn't work, can you show the output of "gcc -dumpspecs"
    from GCC 2.95?

    Attached as 295SPECS.TXT

    OK, but still: there should be no problem with having both on the
    command line, right?

    No, no problems. But detecting and correctly using -lgcc was the
    original goal.

    But -L doesn't contradict that goal, does it?

    I'm trying to understand your question and how you see things:
    What I'm saying is, needing to add an additional -L/some/path for
    -lgcc is really counter-intuitive and unexpected. I guess someone
    has to run gcc -print-libgcc-file-name to manually detect it and
    than add it to his own command line.

    Looks like this is becoming a hassle. Revert the patch and document
    the -lgcc issue instead? (Even though I did like the result of the
    patch where it does run..)

    I'm sorry I'm causing the hassle,

    No, you really are not.

    but can we please not give up just
    yet, and see if we can have the cake and eat it, too?

    OK :)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Sat Jan 28 06:33:03 2023
    When I launch the game though I get an unresolved symbol _stpcpy. But the same
    error happens with an unpatched dxe3gen.

    Yes, later versions of GCC with DJGPP resolve strcpy to stpcpy
    internally.  I have not looked at the code, but I assume it's some kind
    of optimization strategy based on strings with known sizes. I believe
    this started in GCC4.

    Simply add DXE_EXPORT(stpcpy) to the dos/dxe.c file with the rest of the DXE_EXPORT table and recompile.  It's possible there may be some other functions like this in string.h that you will have to do.

    Frank

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Sat Jan 28 14:39:17 2023
    Note that additional "-Tdjgpp-x.djl" at the end which screws up everything.

    What if you use both -T and -Xlinker -T? IOW, pass -T both to GCC and
    to the linker directly?

    That works with gcc-3.4.6, but not with gcc-2.95: adding -v to command line shows that gcc295 invokes ld with -Tdjgpp.djl -T dxe.ld

    If this still doesn't work, can you show the output of "gcc -dumpspecs"
    from GCC 2.95?

    Attached as 295SPECS.TXT [EDIT: really attached it this time.]


    OK, but still: there should be no problem with having both on the
    command line, right?

    No, no problems. But detecting and correctly using -lgcc was the
    original goal.

    But -L doesn't contradict that goal, does it?

    I'm trying to understand your question and how you see things:
    What I'm saying is, needing to add an additional -L/some/path for
    -lgcc is really counter-intuitive and unexpected. I guess someone
    has to run gcc -print-libgcc-file-name to manually detect it and
    than add it to his own command line.

    Looks like this is becoming a hassle. Revert the patch and document
    the -lgcc issue instead? (Even though I did like the result of the
    patch where it does run..)

    I'm sorry I'm causing the hassle,

    No, you really are not.

    but can we please not give up just
    yet, and see if we can have the cake and eat it, too?

    OK :)

    KmFzbToKCgoqYXNtX2ZpbmFsOgoKCipjcHA6CiUoY3BwX2NwdSkgJXtwb3NpeDotRF9QT1NJWF9T T1VSQ0V9IC1pbWFjcm9zICVzZGpncHAudmVyIC1yZW1hcAoKKmNjMToKJShjYzFfY3B1KSAKCipj YzFwbHVzOgoKCiplbmRmaWxlOgoKCipsaW5rOgoKCipsaWI6Ci1sYwoKKmxpYmdjYzoKLWxnY2MK CipzdGFydGZpbGU6CiV7cGc6Z2NydDAubyVzfSV7IXBnOmNydDAubyVzfQoKKnN3aXRjaGVzX25l ZWRfc3BhY2VzOgoKCipzaWduZWRfY2hhcjoKJXtmdW5zaWduZWQtY2hhcjotRF9fQ0hBUl9VTlNJ R05FRF9ffQoKKnByZWRlZmluZXM6Ci1EdW5peCAtRGkzODYgLURHTzMyIC1EREpHUFA9MiAtRE1T RE9TICAgLUFzeXN0ZW0odW5peCkgLUFzeXN0ZW0obXNkb3MpIC1BY3B1KGkzODYpIC1BbWFjaGlu ZShpMzg2KQoKKmNyb3NzX2NvbXBpbGU6CjAKCip2ZXJzaW9uOgoyLjk1LjMKCiptdWx0aWxpYjoK LiA7CgoqbXVsdGlsaWJf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TM4NjotbWNwdT1pMzg2fSAl e200ODY6LW1jcHU9aTQ4Nn0gJXttcGVudGl1bTotbWNwdT1wZW50aXVtfSAle21wZW50aXVtcHJv Oi1tY3B1PXBlbnRpdW1wcm99fQoKKmxpbmtfY29tbWFuZDoKJXshZnN5bnRheC1vbmx5OiAleyFj OiV7IU06JXshTU06JXshRToleyFTOiUobGlua2VyKSAlbCAlWCAle28qfSAle0F9ICV7ZH0gJXtl Kn0gJXttfSAle059ICV7bn0gCSV7cn0gJXtzfSAle3R9ICV7dSp9ICV7eH0gJXt6fSAle1p9CSV7 IUE6JXshbm9zdGRsaWI6JXshbm9zdGFydGZpbGVzOiVTfX19CSV7c3RhdGljOn0gJXtMKn0gJUQg JW8JJXshbm9zdGRsaWI6JXshbm9kZWZhdWx0bGliczolRyAlTCAlR319CSV7IUE6JXshbm9zdGRs aWI6JXshbm9zdGFydGZpbGVzOiVFfX19CS1UZGpncHAuZGpsICV7VCp9fX19fX19CiV7IWM6JXsh TToleyFNTToleyFFOiV7IVM6c3R1YmlmeSAle3Z9ICV7byo6JSp9ICV7IW8qOmEub3V0fSB9fX19 fQoK

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Sat Jan 28 16:08:52 2023
    Note that additional "-Tdjgpp-x.djl" at the end which screws up
    everything.

    What if you use both -T and -Xlinker -T? IOW, pass -T both to GCC and
    to the linker directly?

    That works with gcc-3.4.6, but not with gcc-2.95: adding -v to command
    line shows that gcc295 invokes ld with -Tdjgpp.djl -T dxe.ld

    If this still doesn't work, can you show the output of "gcc -dumpspecs"
    from GCC 2.95?

    Attached as 295SPECS.TXT [EDIT: really attached it this time.]

    OK, I see the problem now. So this means people who use GCC 2.95 will
    have to use the previous version of dxe3gen. In that case, I think
    I'm okay with documenting this and ignoring the problem with GCC 2.95.

    I still don't know what other gcc versions would have an issue
    with the new version, e.g. gcc 3.0, 3.1, 3.2 or 3.3: I only tested
    with 3.4, so I am not 100% comfortable with the patch being in.
    (Also see down below.)

    OK, but still: there should be no problem with having both on the
    command line, right?

    No, no problems. But detecting and correctly using -lgcc was the
    original goal.

    But -L doesn't contradict that goal, does it?

    I'm trying to understand your question and how you see things:
    What I'm saying is, needing to add an additional -L/some/path for
    -lgcc is really counter-intuitive and unexpected. I guess someone
    has to run gcc -print-libgcc-file-name to manually detect it and
    than add it to his own command line.

    Sure, but we are already talking about someone who does something very non-standard.

    For the record, -lgcc is not non-standart,

    I just prefer that we leave those hypothetical people a
    way of keeping their setups, whatever they are, and I think supporting
    DJDIR and DXE_LD_LIBRARY_PATH for adding -L options to the command
    line cannot do any harm to people who use the standard directories,
    right?

    Was the discussion in this section only about DXE_LD_LIBRARY_PATH and/
    or DJDIR support? (I knew we were speaking about different things :)
    No, I am not against restoring DXE_LD_LIBRARY_PATH and/or DJDIR env
    vars recognition.

    BTW, if I revert the patch and go back to the previous version, -lgcc
    problem can be easily worked around when using a makefile, like:
    LIBGCCDIR = $(dir $(shell $(CC) -print-libgcc-file-name))
    my.dxe:
    dxe3gen -o my.dxe -E _sym -U $(OBJS) -L$(LIBGCCDIR) -lgcc

    I even created a documentation patch to dxegen.txi for it. Should we
    really keep the patch in, or revert it?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Sat Jan 28 14:44:27 2023
    From: "Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com]" <djgpp@delorie.com>
    Date: Sat, 28 Jan 2023 14:39:17 +0300

    Note that additional "-Tdjgpp-x.djl" at the end which screws up everything.

    What if you use both -T and -Xlinker -T? IOW, pass -T both to GCC and
    to the linker directly?

    That works with gcc-3.4.6, but not with gcc-2.95: adding -v to command line shows that gcc295 invokes ld with -Tdjgpp.djl -T dxe.ld

    If this still doesn't work, can you show the output of "gcc -dumpspecs" from GCC 2.95?

    Attached as 295SPECS.TXT [EDIT: really attached it this time.]

    OK, I see the problem now. So this means people who use GCC 2.95 will
    have to use the previous version of dxe3gen. In that case, I think
    I'm okay with documenting this and ignoring the problem with GCC 2.95.

    OK, but still: there should be no problem with having both on the
    command line, right?

    No, no problems. But detecting and correctly using -lgcc was the
    original goal.

    But -L doesn't contradict that goal, does it?

    I'm trying to understand your question and how you see things:
    What I'm saying is, needing to add an additional -L/some/path for
    -lgcc is really counter-intuitive and unexpected. I guess someone
    has to run gcc -print-libgcc-file-name to manually detect it and
    than add it to his own command line.

    Sure, but we are already talking about someone who does something very non-standard. I just prefer that we leave those hypothetical people a
    way of keeping their setups, whatever they are, and I think supporting
    DJDIR and DXE_LD_LIBRARY_PATH for adding -L options to the command
    line cannot do any harm to people who use the standard directories,
    right?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Sat Jan 28 15:27:35 2023
    From: "Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com]" <djgpp@delorie.com>
    Date: Sat, 28 Jan 2023 16:08:52 +0300

    I just prefer that we leave those hypothetical people a
    way of keeping their setups, whatever they are, and I think supporting DJDIR and DXE_LD_LIBRARY_PATH for adding -L options to the command
    line cannot do any harm to people who use the standard directories,
    right?

    Was the discussion in this section only about DXE_LD_LIBRARY_PATH and/
    or DJDIR support? (I knew we were speaking about different things :)

    Yes, only about that.

    No, I am not against restoring DXE_LD_LIBRARY_PATH and/or DJDIR env
    vars recognition.

    BTW, if I revert the patch and go back to the previous version, -lgcc
    problem can be easily worked around when using a makefile, like:
    LIBGCCDIR = $(dir $(shell $(CC) -print-libgcc-file-name))
    my.dxe:
    dxe3gen -o my.dxe -E _sym -U $(OBJS) -L$(LIBGCCDIR) -lgcc

    I even created a documentation patch to dxegen.txi for it. Should we
    really keep the patch in, or revert it?

    I'm okay either way.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Sat Jan 28 16:21:48 2023
    BTW, if I revert the patch and go back to the previous version, -lgcc
    problem can be easily worked around when using a makefile, like:
    LIBGCCDIR = $(dir $(shell $(CC) -print-libgcc-file-name))
    my.dxe:
    dxe3gen -o my.dxe -E _sym -U $(OBJS) -L$(LIBGCCDIR) -lgcc

    I even created a documentation patch to dxegen.txi for it. Should we
    really keep the patch in, or revert it?

    And it is unnecessary behavior change when there is actually a solution
    so I vote for reverting.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Sat Jan 28 15:28:49 2023
    From: "Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com]" <djgpp@delorie.com>
    Date: Sat, 28 Jan 2023 16:21:48 +0300

    BTW, if I revert the patch and go back to the previous version, -lgcc problem can be easily worked around when using a makefile, like:
    LIBGCCDIR = $(dir $(shell $(CC) -print-libgcc-file-name))
    my.dxe:
    dxe3gen -o my.dxe -E _sym -U $(OBJS) -L$(LIBGCCDIR) -lgcc

    I even created a documentation patch to dxegen.txi for it. Should we
    really keep the patch in, or revert it?

    And it is unnecessary behavior change when there is actually a solution
    so I vote for reverting.

    Fine by me, thanks.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Sat Jan 28 16:40:27 2023
    BTW, if I revert the patch and go back to the previous version, -lgcc
    problem can be easily worked around when using a makefile, like:
    LIBGCCDIR = $(dir $(shell $(CC) -print-libgcc-file-name))
    my.dxe:
    dxe3gen -o my.dxe -E _sym -U $(OBJS) -L$(LIBGCCDIR) -lgcc

    I even created a documentation patch to dxegen.txi for it. Should we
    really keep the patch in, or revert it?

    And it is unnecessary behavior change when there is actually a solution
    so I vote for reverting.

    Fine by me, thanks.

    OK then, will revert shortly.

    As for documentation, is the following good? Better wording?

    Index: dxegen.txi ===================================================================
    RCS file: /cvs/djgpp/djgpp/src/dxe/dxegen.txi,v
    retrieving revision 1.7
    diff -u -r1.7 dxegen.txi
    --- dxegen.txi 26 Jun 2015 16:39:06 -0000 1.7
    +++ dxegen.txi 28 Jan 2023 12:52:28 -0000
    @@ -214,7 +214,17 @@
    the module and so on. As a workaround, keep such names unexported by
    filtering exported names through @kbd{-E} option.

    +@item
    +Linking to gcc-provided libraries like libgcc may need special care,
    +because the linker may have no idea where libgcc.a is. One solution
    +to that when using a makefile is, retrieving the libgcc directory and +combining it with -L before -lgcc:
    @end itemize
    +@example
    +LIBGCCDIR = $(dir $(shell $(CC) -print-libgcc-file-name))
    +my.dxe:
    + dxe3gen -o my.dxe -E _sym -U $(OBJS) -L$(LIBGCCDIR) -lgcc
    +@end example

    -*- The best way is to leave the symbols unresolved and resolve them at
    runtime. To tell @command{dxe3gen} to not fail on unresolved symbols, add the

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Sat Jan 28 17:12:11 2023
    OK, patch reverted,

    As for documentation, is the following good? Better wording?

    The text is fine, but the markup could be improved:

    +@item
    +Linking to gcc-provided libraries like libgcc may need special care,

    libgcc should be in @file

    +because the linker may have no idea where libgcc.a is. One solution

    libgcc.a likewise

    +to that when using a makefile is, retrieving the libgcc directory and
    +combining it with -L before -lgcc:

    "-L" and "-lgcc" are command-line options, so the suitable markup for
    them is @option.

    Documentation patch is applied as https://www.delorie.com/bin/cvsweb.cgi/djgpp/src/dxe/dxegen.txi.diff?r1=1.9&r2=1.10

    Thanks.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Sat Jan 28 20:10:04 2023
    Also, with removing DXE_LD_LIBRARY_PATH, the concern was that it
    could break existing makefiles. But now the accepted solution is... to
    break existing makefiles?

    How so?? I don't see any breakage to existing makefiles at all,
    care to explain?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to J.W. Jagersma on Sat Jan 28 18:01:44 2023
    On 2023-01-28 17:46, J.W. Jagersma wrote:
    On 2023-01-28 15:12, Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com] wrote:
    OK, patch reverted,

    As for documentation, is the following good? Better wording?

    The text is fine, but the markup could be improved:

    +@item
    +Linking to gcc-provided libraries like libgcc may need special care,

    libgcc should be in @file

    +because the linker may have no idea where libgcc.a is. One solution

    libgcc.a likewise

    +to that when using a makefile is, retrieving the libgcc directory and >>>> +combining it with -L before -lgcc:

    "-L" and "-lgcc" are command-line options, so the suitable markup for
    them is @option.

    Documentation patch is applied as
    https://www.delorie.com/bin/cvsweb.cgi/djgpp/src/dxe/dxegen.txi.diff?r1=1.9&r2=1.10

    Thanks.

    I don't really like this "solution", it just makes it the user's problem.

    How likely is it that someone uses the latest version of dxe3gen, but is somehow stuck with such an ancient (nearly 25 years old) version of gcc? At some point you'll just have to say, for gcc < X, use dxe3gen Y.

    For DXE_LD_LIBRARY_PATH, that can be added easily as -L dir, and won't break anything. But not having this set should not be an error.

    For DJDIR, there is only one valid place it can point to, and gcc already knows
    where to find it. I don't think a native gcc even works without DJDIR set. So
    it doesn't make sense to also parse it in dxe3gen.

    Also, with removing DXE_LD_LIBRARY_PATH, the concern was that it could break existing makefiles. But now the accepted solution is... to break existing makefiles? That logic is hard to follow.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to djgpp@delorie.com] on Sat Jan 28 17:46:17 2023
    On 2023-01-28 15:12, Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com] wrote:
    OK, patch reverted,

    As for documentation, is the following good? Better wording?

    The text is fine, but the markup could be improved:

    +@item
    +Linking to gcc-provided libraries like libgcc may need special care,

    libgcc should be in @file

    +because the linker may have no idea where libgcc.a is. One solution

    libgcc.a likewise

    +to that when using a makefile is, retrieving the libgcc directory and
    +combining it with -L before -lgcc:

    "-L" and "-lgcc" are command-line options, so the suitable markup for
    them is @option.

    Documentation patch is applied as https://www.delorie.com/bin/cvsweb.cgi/djgpp/src/dxe/dxegen.txi.diff?r1=1.9&r2=1.10

    Thanks.

    I don't really like this "solution", it just makes it the user's problem.

    How likely is it that someone uses the latest version of dxe3gen, but is somehow stuck with such an ancient (nearly 25 years old) version of gcc? At some point you'll just have to say, for gcc < X, use dxe3gen Y.

    For DXE_LD_LIBRARY_PATH, that can be added easily as -L dir, and won't break anything. But not having this set should not be an error.

    For DJDIR, there is only one valid place it can point to, and gcc already knows where to find it. I don't think a native gcc even works without DJDIR set. So it doesn't make sense to also parse it in dxe3gen.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to djgpp@delorie.com] on Sat Jan 28 19:09:56 2023
    On 2023-01-28 18:23, Eli Zaretskii (eliz@gnu.org) [via djgpp@delorie.com] wrote:
    Date: Sat, 28 Jan 2023 18:01:44 +0100
    From: "J.W. Jagersma (jwjagersma@gmail.com) [via djgpp@delorie.com]" <djgpp@delorie.com>


    I don't really like this "solution", it just makes it the user's problem. >>>
    How likely is it that someone uses the latest version of dxe3gen, but is >>> somehow stuck with such an ancient (nearly 25 years old) version of gcc? At
    some point you'll just have to say, for gcc < X, use dxe3gen Y.

    For DXE_LD_LIBRARY_PATH, that can be added easily as -L dir, and won't break
    anything. But not having this set should not be an error.

    For DJDIR, there is only one valid place it can point to, and gcc already knows
    where to find it. I don't think a native gcc even works without DJDIR set. So
    it doesn't make sense to also parse it in dxe3gen.

    Also, with removing DXE_LD_LIBRARY_PATH, the concern was that it could break >> existing makefiles. But now the accepted solution is... to break existing >> makefiles? That logic is hard to follow.

    If you can propose a patch that caters to your use case without
    breaking the "traditional" one, please do, and let's take it from
    there.

    GCC 2.95 is not a blocking problem, from my POV. But I don't want to
    lose support for DJDIR and DXE_LD_LIBRARY_PATH, because someone could
    have set them in their build procedures for some reason, and have them
    point to some strange places that neither me nor you can imagine.

    Are there any fundamental problems that would preclude invoking GCC
    instead of ld (so that your case is supported), but still have the -L
    switch added to the GCC command line, whose argument is derived from DXE_LD_LIBRARY_PATH or from DJDIR if those are set? IOW, can we have
    the code work as you wanted when these two variables aren't set, but
    add the additional -L switch when they are?

    Sure, that should be possible. Starting from the patch I submitted earlier, simply adding DXE_LD_LIBRARY_PATH via -L will achieve that.

    For DJDIR, again, having it set to anything other than the djgpp install location is *always* user error. Many things rely on this, and to me it doesn't seem very useful to support invalid configurations in dxe3gen.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to djgpp@delorie.com] on Sat Jan 28 18:27:19 2023
    On 2023-01-28 18:10, Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com] wrote:
    Also, with removing DXE_LD_LIBRARY_PATH, the concern was that it
    could break existing makefiles. But now the accepted solution is... to
    break existing makefiles?

    How so?? I don't see any breakage to existing makefiles at all,
    care to explain?

    It implies that, if one wants to build a DXE project that was written for the native compiler (where libc, libgcc, libstc++ are all in one directory), it is now up to the user to edit the makefiles in case his/her configuration uses multiple lib directories (as is typically the case in a cross compiler).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Sat Jan 28 19:40:24 2023
    Date: Sat, 28 Jan 2023 18:27:19 +0100
    From: "J.W. Jagersma (jwjagersma@gmail.com) [via djgpp@delorie.com]" <djgpp@delorie.com>

    It implies that, if one wants to build a DXE project that was written for the native compiler (where libc, libgcc, libstc++ are all in one directory)

    No, in a native installation libgcc and libstdc++ are in a directory
    different from libc. We just didn't support linking against those two libraries because AFAIU it was never needed by anyone, definitely in
    the case of libstdc++.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Sat Jan 28 19:23:02 2023
    Date: Sat, 28 Jan 2023 18:01:44 +0100
    From: "J.W. Jagersma (jwjagersma@gmail.com) [via djgpp@delorie.com]" <djgpp@delorie.com>


    I don't really like this "solution", it just makes it the user's problem.

    How likely is it that someone uses the latest version of dxe3gen, but is somehow stuck with such an ancient (nearly 25 years old) version of gcc? At
    some point you'll just have to say, for gcc < X, use dxe3gen Y.

    For DXE_LD_LIBRARY_PATH, that can be added easily as -L dir, and won't break
    anything. But not having this set should not be an error.

    For DJDIR, there is only one valid place it can point to, and gcc already knows
    where to find it. I don't think a native gcc even works without DJDIR set. So
    it doesn't make sense to also parse it in dxe3gen.

    Also, with removing DXE_LD_LIBRARY_PATH, the concern was that it could break existing makefiles. But now the accepted solution is... to break existing makefiles? That logic is hard to follow.

    If you can propose a patch that caters to your use case without
    breaking the "traditional" one, please do, and let's take it from
    there.

    GCC 2.95 is not a blocking problem, from my POV. But I don't want to
    lose support for DJDIR and DXE_LD_LIBRARY_PATH, because someone could
    have set them in their build procedures for some reason, and have them
    point to some strange places that neither me nor you can imagine.

    Are there any fundamental problems that would preclude invoking GCC
    instead of ld (so that your case is supported), but still have the -L
    switch added to the GCC command line, whose argument is derived from DXE_LD_LIBRARY_PATH or from DJDIR if those are set? IOW, can we have
    the code work as you wanted when these two variables aren't set, but
    add the additional -L switch when they are?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to djgpp@delorie.com] on Sat Jan 28 19:12:06 2023
    On 2023-01-28 18:40, Eli Zaretskii (eliz@gnu.org) [via djgpp@delorie.com] wrote:
    Date: Sat, 28 Jan 2023 18:27:19 +0100
    From: "J.W. Jagersma (jwjagersma@gmail.com) [via djgpp@delorie.com]" <djgpp@delorie.com>

    It implies that, if one wants to build a DXE project that was written for the
    native compiler (where libc, libgcc, libstc++ are all in one directory)

    No, in a native installation libgcc and libstdc++ are in a directory different from libc. We just didn't support linking against those two libraries because AFAIU it was never needed by anyone, definitely in
    the case of libstdc++.

    On my end, libc and libstdc++ are in %DJDIR%\lib\. But I see libgcc is in %DJDIR%\lib\gcc\djgpp\12\.
    It is probably possible to configure gcc/libstdc++ to place these in any arbitrary location. I think it's best if dxe3gen and makefile writers have no knowledge of a user's particular configuration, and simply leave it to gcc to figure it out.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to djgpp@delorie.com on Sat Jan 28 22:33:33 2023
    On 1/28/23, Eli Zaretskii (eliz@gnu.org) [via djgpp@delorie.com] <djgpp@delorie.com> wrote:
    We just didn't support linking against those two
    libraries because AFAIU it was never needed by anyone,

    Exactly.

    And anyone who needed it copied it (them) to a directory
    accessible by cross-ld and used it that way. So, nothing has
    changed, hence no incompatibility introduced.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Sat Jan 28 22:04:38 2023
    Date: Sat, 28 Jan 2023 19:12:06 +0100
    From: "J.W. Jagersma (jwjagersma@gmail.com) [via djgpp@delorie.com]" <djgpp@delorie.com>

    No, in a native installation libgcc and libstdc++ are in a directory different from libc. We just didn't support linking against those two libraries because AFAIU it was never needed by anyone, definitely in
    the case of libstdc++.

    On my end, libc and libstdc++ are in %DJDIR%\lib\. But I see libgcc is in %DJDIR%\lib\gcc\djgpp\12\.

    libgcc should be in a version-specific directory under either lib/gcc
    or lib/gcc-lib. libstdc++ is normally also in that subdirectory, I
    don't know why you have it in lib. It is version-specific, so cannot
    be in the general lib directory.

    It is probably possible to configure gcc/libstdc++ to place these in any arbitrary location. I think it's best if dxe3gen and makefile writers have no
    knowledge of a user's particular configuration, and simply leave it to gcc to figure it out.

    Yes, that's true. No argument there. I'm just saying that if someone
    has some unusual (read: crazy) non-standard configuration, where
    libraries can be found via these two environment variables, we
    shouldn't break those unusual configurations.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Sat Jan 28 21:57:30 2023
    Date: Sat, 28 Jan 2023 19:09:56 +0100
    From: "J.W. Jagersma (jwjagersma@gmail.com) [via djgpp@delorie.com]" <djgpp@delorie.com>

    Are there any fundamental problems that would preclude invoking GCC
    instead of ld (so that your case is supported), but still have the -L switch added to the GCC command line, whose argument is derived from DXE_LD_LIBRARY_PATH or from DJDIR if those are set? IOW, can we have
    the code work as you wanted when these two variables aren't set, but
    add the additional -L switch when they are?

    Sure, that should be possible. Starting from the patch I submitted earlier, simply adding DXE_LD_LIBRARY_PATH via -L will achieve that.

    Good.

    For DJDIR, again, having it set to anything other than the djgpp install location is *always* user error. Many things rely on this, and to me it doesn't seem very useful to support invalid configurations in dxe3gen.

    Once again: adding one more -L switch to a compiler command line
    cannot possibly do any harm.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to djgpp@delorie.com] on Sat Jan 28 22:01:54 2023
    On 2023-01-28 20:33, Ozkan Sezer (sezeroz@gmail.com) [via djgpp@delorie.com] wrote:
    On 1/28/23, Eli Zaretskii (eliz@gnu.org) [via djgpp@delorie.com] <djgpp@delorie.com> wrote:
    We just didn't support linking against those two
    libraries because AFAIU it was never needed by anyone,

    Exactly.

    And anyone who needed it copied it (them) to a directory
    accessible by cross-ld and used it that way. So, nothing has
    changed, hence no incompatibility introduced.

    But then anyone else who wants to build that code, will also have modify their installation and copy those files. So that spreads the problem out, while it could be solved in a single location instead.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to djgpp@delorie.com] on Sat Jan 28 21:51:25 2023
    On 2023-01-28 21:04, Eli Zaretskii (eliz@gnu.org) [via djgpp@delorie.com] wrote:
    Date: Sat, 28 Jan 2023 19:12:06 +0100
    From: "J.W. Jagersma (jwjagersma@gmail.com) [via djgpp@delorie.com]" <djgpp@delorie.com>

    No, in a native installation libgcc and libstdc++ are in a directory
    different from libc. We just didn't support linking against those two
    libraries because AFAIU it was never needed by anyone, definitely in
    the case of libstdc++.

    On my end, libc and libstdc++ are in %DJDIR%\lib\. But I see libgcc is in >> %DJDIR%\lib\gcc\djgpp\12\.

    libgcc should be in a version-specific directory under either lib/gcc
    or lib/gcc-lib. libstdc++ is normally also in that subdirectory, I
    don't know why you have it in lib. It is version-specific, so cannot
    be in the general lib directory.

    That would indicate a problem (?) with the recent gpp*b.zip packages then.
    From 4.7.4 on, they all come with libstdcxx.a in lib/.

    It is probably possible to configure gcc/libstdc++ to place these in any
    arbitrary location. I think it's best if dxe3gen and makefile writers have no
    knowledge of a user's particular configuration, and simply leave it to gcc to
    figure it out.

    Yes, that's true. No argument there. I'm just saying that if someone
    has some unusual (read: crazy) non-standard configuration, where
    libraries can be found via these two environment variables, we
    shouldn't break those unusual configurations.

    If you think it should be kept, then I won't object too much. A duplicate -L entry indeed does no harm. I'm just saying it's completely redundant - native gcc will not work with an invalid DJDIR, and it will always put %DJDIR%/lib in the default library path.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)