forked from Imagelibrary/rtems
build: Remove enabled-by special case
Doing the enabled-by processing just for the ldflags and just for the link custom commands is confusing. Use an option instead which is intended to be used for such use cases.
This commit is contained in:
@@ -33,9 +33,7 @@ enabled-by:
|
||||
includes:
|
||||
- testsuites/libtests/dl07
|
||||
ldflags:
|
||||
- enabled-by:
|
||||
- microblaze
|
||||
value: -u__extendsfdf2
|
||||
- ${LIBDL_TESTS_LDFLAGS}
|
||||
links: []
|
||||
prepare-build: null
|
||||
prepare-configure: null
|
||||
|
||||
@@ -38,9 +38,7 @@ enabled-by:
|
||||
includes:
|
||||
- testsuites/libtests/dl08
|
||||
ldflags:
|
||||
- enabled-by:
|
||||
- microblaze
|
||||
value: -u__extendsfdf2
|
||||
- ${LIBDL_TESTS_LDFLAGS}
|
||||
links: []
|
||||
prepare-build: null
|
||||
prepare-configure: null
|
||||
|
||||
@@ -33,9 +33,7 @@ enabled-by:
|
||||
includes:
|
||||
- testsuites/libtests/dl09
|
||||
ldflags:
|
||||
- enabled-by:
|
||||
- microblaze
|
||||
value: -u__extendsfdf2
|
||||
- ${LIBDL_TESTS_LDFLAGS}
|
||||
links: []
|
||||
prepare-build: null
|
||||
prepare-configure: null
|
||||
|
||||
@@ -22,6 +22,8 @@ links:
|
||||
uid: ../optgzip
|
||||
- role: build-dependency
|
||||
uid: ../optxz
|
||||
- role: build-dependency
|
||||
uid: optdlldflags
|
||||
- role: build-dependency
|
||||
uid: optrtemsld
|
||||
- role: build-dependency
|
||||
|
||||
22
spec/build/testsuites/libtests/optdlldflags.yml
Normal file
22
spec/build/testsuites/libtests/optdlldflags.yml
Normal file
@@ -0,0 +1,22 @@
|
||||
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
|
||||
actions:
|
||||
- get-string: null
|
||||
- split: null
|
||||
- env-assign: null
|
||||
build-type: option
|
||||
copyrights:
|
||||
- Copyright (C) 2023 embedded brains GmbH & Co. KG
|
||||
default:
|
||||
- enabled-by: microblaze
|
||||
value:
|
||||
- -u__extendsfdf2
|
||||
- enabled-by: true
|
||||
value: []
|
||||
description: |
|
||||
Linker flags used to link libdl tests with a base image. For example, it may
|
||||
be used to add undefined symbols which the linker has to resolve to pull in
|
||||
services required by loaded parts.
|
||||
enabled-by: true
|
||||
links: []
|
||||
name: LIBDL_TESTS_LDFLAGS
|
||||
type: build
|
||||
12
wscript
12
wscript
@@ -360,7 +360,7 @@ class Item(object):
|
||||
def __init__(self, item, bic, cmd, env, ldflags):
|
||||
super(link, self).__init__(self, env=env)
|
||||
self.cmd = cmd
|
||||
self.ldflags = bic.ldflags + ldflags
|
||||
self.ldflags = ldflags
|
||||
self.stlib = item.data["stlib"]
|
||||
self.use = (item.data["use-before"] + bic.use +
|
||||
item.data["use-after"])
|
||||
@@ -386,14 +386,8 @@ class Item(object):
|
||||
[],
|
||||
)
|
||||
|
||||
ldflags = []
|
||||
for ldflag in self.data["ldflags"]:
|
||||
if isinstance(ldflag, dict):
|
||||
if _is_enabled(bld.env.ENABLE, ldflag["enabled-by"]):
|
||||
ldflags.append(ldflag["value"])
|
||||
else:
|
||||
ldflags.append(ldflag)
|
||||
tsk = link(self, bic, cmd, bld.env, ldflags)
|
||||
tsk = link(self, bic, cmd, bld.env,
|
||||
bic.ldflags + self.substitute(bld, self.data["ldflags"]))
|
||||
tsk.set_inputs([bld.bldnode.make_node(s) for s in source])
|
||||
tsk.set_outputs(bld.bldnode.make_node(target))
|
||||
bld.add_to_group(tsk)
|
||||
|
||||
Reference in New Issue
Block a user