Skip to content

Conversation

@statham-arm
Copy link
Contributor

Commit 23f1d75 included $(LLVM_TOOLCHAIN_C_LIBRARY), which isn't valid cmake syntax – to interpolate a cmake variable you have to use braces, not parentheses.

This led to a mysterious error from git

fatal: cannot change to 'rev-parse': No such file or directory

because once ${base_library} is set to something that doesn't make sense, git -C ${${base_library}_SOURCE_DIR} rev-parse HEAD substitutes nothing at all for the source directory, and the command collapses to just git -C rev-parse which indeed interprets rev-parse as the directory to change into.

Commit 23f1d75 included `$(LLVM_TOOLCHAIN_C_LIBRARY)`, which
isn't valid cmake syntax – to interpolate a cmake variable you have to
use braces, not parentheses.

This led to a mysterious error from git

fatal: cannot change to 'rev-parse': No such file or directory

because once `${base_library}` is set to something that doesn't make
sense, `git -C ${${base_library}_SOURCE_DIR} rev-parse HEAD`
substitutes nothing at all for the source directory, and the command
collapses to just `git -C rev-parse` which indeed interprets
`rev-parse` as the directory to change into.
Copy link
Contributor

@pratlucas pratlucas left a comment

Choose a reason for hiding this comment

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

LGTM.

@statham-arm statham-arm merged commit 5daa268 into arm:arm-software Feb 17, 2025
@statham-arm statham-arm deleted the version-txt-syntax-fix branch February 17, 2025 12:02
pratlucas pushed a commit to pratlucas/arm-toolchain that referenced this pull request Feb 28, 2025
Commit 23f1d75 included `$(LLVM_TOOLCHAIN_C_LIBRARY)`, which
isn't valid cmake syntax – to interpolate a cmake variable you have to
use braces, not parentheses.

This led to a mysterious error from git

fatal: cannot change to 'rev-parse': No such file or directory

because once `${base_library}` is set to something that doesn't make
sense, `git -C ${${base_library}_SOURCE_DIR} rev-parse HEAD` substitutes
nothing at all for the source directory, and the command collapses to
just `git -C rev-parse` which indeed interprets `rev-parse` as the
directory to change into.
pratlucas pushed a commit that referenced this pull request Feb 28, 2025
Commit 23f1d75 included `$(LLVM_TOOLCHAIN_C_LIBRARY)`, which
isn't valid cmake syntax – to interpolate a cmake variable you have to
use braces, not parentheses.

This led to a mysterious error from git

fatal: cannot change to 'rev-parse': No such file or directory

because once `${base_library}` is set to something that doesn't make
sense, `git -C ${${base_library}_SOURCE_DIR} rev-parse HEAD` substitutes
nothing at all for the source directory, and the command collapses to
just `git -C rev-parse` which indeed interprets `rev-parse` as the
directory to change into.
llvm-sync bot pushed a commit that referenced this pull request Aug 6, 2025
… >= 4G (#151460)"

This reverts commit 600976f.

The test was crashing trying to access any element of the GPR struct.

(gdb) disas
Dump of assembler code for function _ZN7testing8internal11CmpHelperEQIyyEENS_15AssertionResultEPKcS4_RKT_RKT0_:
   0x00450afc <+0>:	push	{r4, r5, r6, r7, r8, r9, r10, r11, lr}
   0x00450b00 <+4>:	sub	sp, sp, #60	; 0x3c
   0x00450b04 <+8>:	ldr	r5, [sp, #96]	; 0x60
=> 0x00450b08 <+12>:	ldm	r3, {r4, r7}
   0x00450b0c <+16>:	ldm	r5, {r6, r9}
   0x00450b10 <+20>:	eor	r7, r7, r9
   0x00450b14 <+24>:	eor	r6, r4, r6
   0x00450b18 <+28>:	orrs	r7, r6, r7

(gdb) p/x r3
$3 = 0x3e300f6e

"However, load and store multiple instructions (LDM and STM) and load and store double-word (LDRD or STRD) must be aligned to at least a word boundary."

https://developer.arm.com/documentation/den0013/d/Porting/Alignment

>>> 0x3e300f6e % 4
2

Program received signal SIGBUS, Bus error.
0x00450b08 in testing::AssertionResult testing::internal::CmpHelperEQ<unsigned long long, unsigned long long>(char const*, char const*, unsigned long long const&, unsigned long long const&) ()

The struct is packed with 1 byte alignment, but it needs to start at an aligned address for us
to ldm from it. So I've done that with alignas.

Also fixed some compiler warnings in the test itself.
llvm-sync bot pushed a commit that referenced this pull request Aug 6, 2025
…RM64` if PC >= 4G (#151460)"

This reverts commit 600976f.

The test was crashing trying to access any element of the GPR struct.

(gdb) disas
Dump of assembler code for function _ZN7testing8internal11CmpHelperEQIyyEENS_15AssertionResultEPKcS4_RKT_RKT0_:
   0x00450afc <+0>:	push	{r4, r5, r6, r7, r8, r9, r10, r11, lr}
   0x00450b00 <+4>:	sub	sp, sp, #60	; 0x3c
   0x00450b04 <+8>:	ldr	r5, [sp, #96]	; 0x60
=> 0x00450b08 <+12>:	ldm	r3, {r4, r7}
   0x00450b0c <+16>:	ldm	r5, {r6, r9}
   0x00450b10 <+20>:	eor	r7, r7, r9
   0x00450b14 <+24>:	eor	r6, r4, r6
   0x00450b18 <+28>:	orrs	r7, r6, r7

(gdb) p/x r3
$3 = 0x3e300f6e

"However, load and store multiple instructions (LDM and STM) and load and store double-word (LDRD or STRD) must be aligned to at least a word boundary."

https://developer.arm.com/documentation/den0013/d/Porting/Alignment

>>> 0x3e300f6e % 4
2

Program received signal SIGBUS, Bus error.
0x00450b08 in testing::AssertionResult testing::internal::CmpHelperEQ<unsigned long long, unsigned long long>(char const*, char const*, unsigned long long const&, unsigned long long const&) ()

The struct is packed with 1 byte alignment, but it needs to start at an aligned address for us
to ldm from it. So I've done that with alignas.

Also fixed some compiler warnings in the test itself.
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.

2 participants