mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-05 23:22:25 +00:00
additional opts should be on the left of other CFLAGS,
this fixes linking to third party libraries issue on some operating systems including Ubuntu and Debian, probably older gcc 11 is to blame. Did not notice this problem on Gentoo, at least with gcc 13.
This commit is contained in:
parent
bd35c73c1f
commit
b8d08c007a
1 changed files with 4 additions and 4 deletions
|
|
@ -44,12 +44,13 @@ BEGIN
|
|||
END execute;
|
||||
|
||||
|
||||
PROCEDURE InitialiseCompilerCommand(VAR s: ARRAY OF CHAR);
|
||||
PROCEDURE InitialiseCompilerCommand(VAR s: ARRAY OF CHAR; additionalopts: ARRAY OF CHAR);
|
||||
BEGIN
|
||||
COPY(Configuration.compile, s);
|
||||
Strings.Append(' -I "', s);
|
||||
Strings.Append(OPM.ResourceDir, s);
|
||||
Strings.Append('/include" ', s);
|
||||
Strings.Append(additionalopts, s);
|
||||
Platform.GetEnv("CFLAGS", CFLAGS);
|
||||
Strings.Append (CFLAGS, s);
|
||||
Strings.Append (" ", s);
|
||||
|
|
@ -60,7 +61,7 @@ PROCEDURE Assemble*(moduleName: ARRAY OF CHAR);
|
|||
VAR
|
||||
cmd: CommandString;
|
||||
BEGIN
|
||||
InitialiseCompilerCommand(cmd);
|
||||
InitialiseCompilerCommand(cmd, "");
|
||||
Strings.Append("-c ", cmd);
|
||||
Strings.Append(moduleName, cmd);
|
||||
Strings.Append(".c", cmd);
|
||||
|
|
@ -72,10 +73,9 @@ PROCEDURE LinkMain*(VAR moduleName: ARRAY OF CHAR; statically: BOOLEAN; addition
|
|||
VAR
|
||||
cmd: CommandString;
|
||||
BEGIN
|
||||
InitialiseCompilerCommand(cmd);
|
||||
InitialiseCompilerCommand(cmd, additionalopts);
|
||||
Strings.Append(moduleName, cmd);
|
||||
Strings.Append(".c ", cmd);
|
||||
Strings.Append(additionalopts, cmd);
|
||||
IF statically THEN
|
||||
IF Configuration.os = "darwin" THEN
|
||||
Strings.Append(OPM.InstallDir, cmd);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue