Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: mk/lib.mk: use full path to shared library in flags variable #5834

Merged
merged 1 commit into from
Feb 21, 2023

Conversation

jforissier
Copy link
Contributor

To add link flags for a shared library, a makefile variable is used that is called lib-ldflags$(libuuid). That's incorrect because the UUID is not enough to uniquely identify a shared library in the build. For example when both 32-bit and 64-bit user space is generated there are two versions of the shared library with the same UUID. It is not a problem at the moment because lib-ldflags$(libuuid) is used only for one target: ta_arm64, but fix this anyways so that the variable may be used for more complex cases.

Copy link
Contributor

@jenswi-linaro jenswi-linaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can drop the build: prefix from the commit.

@@ -60,14 +60,14 @@ $(lib-libfile): $(objs)
endif
ifeq ($(CFG_ULIBS_SHARED),y)
ifeq ($(sm)-$(CFG_TA_BTI),ta_arm64-y)
lib-ldflags$(libuuid) += $$(call ld-option,-z force-bti) --fatal-warnings
lib-ldflags$(lib-shlibfile) += $$(call ld-option,-z force-bti) --fatal-warnings
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lib-shlibfile is empty when CFG_ULIBS_SHARED isn't y

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, this comment would be more relevant below at line 70.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 70 is stilll in the ifeq ($(CFG_ULIBS_SHARED),y) .. endif block

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, you're right.

@jforissier jforissier force-pushed the shlib-flags branch 2 times, most recently from 570bb55 to cdf0097 Compare February 20, 2023 15:48
@jenswi-linaro
Copy link
Contributor

Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>

To add link flags for a shared library, a makefile variable is used
that is called lib-ldflags$(libuuid). That's incorrect because the
UUID is not enough to uniquely identify a shared library in the build.
For example when both 32-bit and 64-bit user space is generated there
are two versions of the shared library with the same UUID. It is not
a problem at the moment because lib-ldflags$(libuuid) is used only
for one target: ta_arm64, but fix this anyways so that the variable
may be used for more complex cases.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
@jforissier jforissier merged commit b489a61 into OP-TEE:master Feb 21, 2023
@jforissier jforissier deleted the shlib-flags branch February 21, 2023 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants