>> 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"))