Skip to content

Commit ffe9669

Browse files
committed
Introduce compiler.libraries.ldflags
Choosing compiler.ldflags for precompiled libraries was an unfortunate choice, since some cores define it in "wrong" places (or it's already in use for other flags). Deprecate the old behaviour and add a specific flag that should be added to recipe.combine in the right position to let the linker find the libraries.
1 parent b324f9b commit ffe9669

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

constants/constants.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ const BUILD_PROPERTIES_BUILD_VARIANT = "build.variant"
4949
const BUILD_PROPERTIES_BUILD_VARIANT_PATH = "build.variant.path"
5050
const BUILD_PROPERTIES_COMPILER_C_ELF_FLAGS = "compiler.c.elf.flags"
5151
const BUILD_PROPERTIES_COMPILER_LDFLAGS = "compiler.ldflags"
52+
const BUILD_PROPERTIES_COMPILER_LIBRARIES_LDFLAGS = "compiler.libraries.ldflags"
5253
const BUILD_PROPERTIES_COMPILER_CPP_FLAGS = "compiler.cpp.flags"
5354
const BUILD_PROPERTIES_COMPILER_PATH = "compiler.path"
5455
const BUILD_PROPERTIES_COMPILER_WARNING_FLAGS = "compiler.warning_flags"

phases/libraries_builder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func fixLDFLAGforPrecompiledLibraries(ctx *types.Context, libraries []*types.Lib
9090
name = strings.Replace(name, "lib", "", 1)
9191
libs_cmd += "-l" + name + " "
9292
}
93-
ctx.BuildProperties[constants.BUILD_PROPERTIES_COMPILER_LDFLAGS] += "\"-L" + path + "\" " + libs_cmd
93+
ctx.BuildProperties[constants.BUILD_PROPERTIES_COMPILER_LIBRARIES_LDFLAGS] = "\"-L" + path + "\" " + libs_cmd
9494
}
9595
}
9696
return nil

0 commit comments

Comments
 (0)