Inline assembler in padlock.c is incompatible with LTO #312
Labels
No labels
api-spec
bug
CLA requested
CLA valid
compliance
DO NOT MERGE
duplicate
enhancement
feature branch
good first issue
HEADER FORMATTING ISSUE
help wanted
Information
invalid
Jira status: AWAITING REVIEW
Jira status: CLOSED
Jira status: DONE
Jira status: IN PROGRESS
Jira status: IN REVIEW
Jira status: OPEN
Jira status: REOPENED
Jira status: RESOLVED
mirrored
mirror internally
needs: backports
needs: ci
needs: design review
needs: preceding PR
needs: review
needs: work
notabug
open for community contribution
Product Backlog
question
ready for merge
security
stale
type: bug
type: enhancement
type: question
web pages
wontfix
writing
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-ARMmbed/mbed-crypto#312
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
When using LTO, the non-local label 'unsupported' may be instantiated several times in the traslation unit (which is the whole program with LTO typically). This leads to an error during linking:
[ 212s] ../../contrib/mbedtls/library/padlock.c: Assembler messages:
[ 212s] ../../contrib/mbedtls/library/padlock.c:64: Error: symbol `unsupported' is already defined
[ 212s] lto-wrapper: fatal error: cc returned 1 exit status
[ 212s] compilation terminated.
[ 212s] /usr/lib/gcc/i586-suse-linux/9/../../../../i586-suse-linux/bin/ld: error: lto-wrapper failed
github.com/ARMmbed/mbed-crypto@08c674dfe3/library/padlock.c (L61-L64)This happens when compiling premake5, which statically links to a bundled mbedtls.
Only ix86 (32bit) is affected, as the padlock code is left out otherwise.
The problem can probably avoided by using local labels in the asm code, e.g.
or assembler templates,
unsupported_%=:. A local label likely is the better option, as it avoids generating a globally visible symbol in the firs place.Issue request type
This has also been raised against Mbed TLS at https://github.com/Mbed-TLS/mbedtls/issues/3451 and has been fixed in Mbed TLS by https://github.com/Mbed-TLS/mbedtls/pull/3452.