From 53d26629a03c70c02d3a143ed3f883d2c826258a Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Mon, 22 Nov 2021 19:50:55 +0100 Subject: [PATCH 1/4] Rerun build script when archive changes Fixes https://github.com/rust-embedded/cortex-m-rt/issues/236 --- build.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/build.rs b/build.rs index 6758d9ef..96a8560d 100644 --- a/build.rs +++ b/build.rs @@ -19,12 +19,10 @@ fn main() { let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap()); if target.starts_with("thumbv") { - fs::copy( - format!("bin/{}.a", target), - out_dir.join("libcortex-m-rt.a"), - ) - .unwrap(); + let lib_path = format!("bin/{}.a", target); + fs::copy(&lib_path, out_dir.join("libcortex-m-rt.a")).unwrap(); println!("cargo:rustc-link-lib=static=cortex-m-rt"); + println!("cargo:rerun-if-changed={}", lib_path); } // Put the linker script somewhere the linker can find it From abfb8cc34dfcf20d550b5cb785cce8d1b8f6da43 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Mon, 22 Nov 2021 19:51:05 +0100 Subject: [PATCH 2/4] Assemble with debuginfo --- assemble.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/assemble.sh b/assemble.sh index b914fedd..9b1f15c4 100755 --- a/assemble.sh +++ b/assemble.sh @@ -9,25 +9,25 @@ crate=cortex-m-rt # remove existing blobs because otherwise this will append object files to the old blobs rm -f bin/*.a -arm-none-eabi-gcc -c -march=armv6s-m asm.S -o bin/$crate.o +arm-none-eabi-gcc -g -c -march=armv6s-m asm.S -o bin/$crate.o ar crs bin/thumbv6m-none-eabi.a bin/$crate.o -arm-none-eabi-gcc -c -march=armv7-m asm.S -o bin/$crate.o +arm-none-eabi-gcc -g -c -march=armv7-m asm.S -o bin/$crate.o ar crs bin/thumbv7m-none-eabi.a bin/$crate.o -arm-none-eabi-gcc -c -march=armv7e-m asm.S -o bin/$crate.o +arm-none-eabi-gcc -g -c -march=armv7e-m asm.S -o bin/$crate.o ar crs bin/thumbv7em-none-eabi.a bin/$crate.o -arm-none-eabi-gcc -c -march=armv7e-m asm.S -DHAS_FPU -o bin/$crate.o +arm-none-eabi-gcc -g -c -march=armv7e-m asm.S -DHAS_FPU -o bin/$crate.o ar crs bin/thumbv7em-none-eabihf.a bin/$crate.o -arm-none-eabi-gcc -c -march=armv8-m.base asm.S -o bin/$crate.o +arm-none-eabi-gcc -g -c -march=armv8-m.base asm.S -o bin/$crate.o ar crs bin/thumbv8m.base-none-eabi.a bin/$crate.o -arm-none-eabi-gcc -c -march=armv8-m.main asm.S -o bin/$crate.o +arm-none-eabi-gcc -g -c -march=armv8-m.main asm.S -o bin/$crate.o ar crs bin/thumbv8m.main-none-eabi.a bin/$crate.o -arm-none-eabi-gcc -c -march=armv8-m.main -DHAS_FPU asm.S -o bin/$crate.o +arm-none-eabi-gcc -g -c -march=armv8-m.main -DHAS_FPU asm.S -o bin/$crate.o ar crs bin/thumbv8m.main-none-eabihf.a bin/$crate.o rm bin/$crate.o From 9c88eab9b2f0165de6d50a7ee737e52e391281ef Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Mon, 22 Nov 2021 19:51:33 +0100 Subject: [PATCH 3/4] Preserve `lr` and add debuginfo --- asm.S | 4 ++++ bin/thumbv6m-none-eabi.a | Bin 1618 -> 2738 bytes bin/thumbv7em-none-eabi.a | Bin 1598 -> 2746 bytes bin/thumbv7em-none-eabihf.a | Bin 1622 -> 2778 bytes bin/thumbv7m-none-eabi.a | Bin 1598 -> 2746 bytes bin/thumbv8m.base-none-eabi.a | Bin 1622 -> 2742 bytes bin/thumbv8m.main-none-eabi.a | Bin 1602 -> 2750 bytes bin/thumbv8m.main-none-eabihf.a | Bin 1626 -> 2782 bytes 8 files changed, 4 insertions(+) diff --git a/asm.S b/asm.S index 62541298..b4d40548 100644 --- a/asm.S +++ b/asm.S @@ -94,6 +94,10 @@ Reset: #endif 4: +.cfi_def_cfa sp, 0 + push {lr} +.cfi_offset lr, 0 + # Jump to user main function. We use bl for the extended range, but the # user main function may not return. bl main diff --git a/bin/thumbv6m-none-eabi.a b/bin/thumbv6m-none-eabi.a index 3ac07773ba3b5f2f5df4d164d992e5250a977bbd..c145cc612cc7348062f3c5cf0b891805a5e65e96 100644 GIT binary patch literal 2738 zcmb7G&re)c6h7}gpu+$oQYzGHn3*z>Sb0+@(wbCLh($1r zqx2sz#+6ImbmhX0dltqRSM5L0=!#_*HPP6l_0nT zw3d1bnMM2FgNK=e$43ty_TxLSdS~hQkH^P%ma@y)6)E0cwC?sCK03-Q_pkK7eS6Wq zoB1Vk_}7vAKrgv}48$qB#3x|A(jzZJ+LrYwHzb%IXM_f2!c5M#ChTYI7dW!WkMy!k z;*3}Ypj<557M!*BoK+~zoGlcJu$3r^#ey@MFU>fMd1ufqI|FXHY}*)7-fhVahVKda!a1}pgie|pO#9c z75J4}qZUe~(yq4K5Pl@uTVCjq#AO5Lk9kdNnX8>JbEC3iK8W6FD-MM35u?dL=; zQI3gRrW_Z!LU~$*YqXz_E|ZO5uaHB|#PT&t1bvqhM}WI(V=KAaHjV&y(FWnou(4$b zY2=Hs*e-7S<9g^-A;Tb&yQ<+)4#hQ9 zaal7r@b}y&6;3?k#t^;bM&0tO`#Tl$!n+;4g1AwPsIS)8ZX&$#^{Umtzm>Flf!Ema zku-8hjSU(*d$o2L&na@*#_x(R?!vV-*9*g-R^1OV{(peyoab6^B=B0_f4UBd4{m%=8VzyKK7IM3&+sBDWE3b3S=_gGB}%pe#BL@ zWV~G%c%B)LHPCn)&~;5va{9a?g|!}xU`Mj!L?-O#*0Lf0`+ z30S5`%Rr7)$eZsF%fG3 delta 373 zcmXw#y-Nc@5XIl^CFVYosEL8AB#;m;7C|9`MT8WBo!Z)Ip|yggwY6ay5d^VKqt+Jw z4R%5hOIs^J!T8<=AN%&VvpYM(?qlPne0d$N_18x?-THY5so3|(QAK6+x*1Ksey4Z? zY&pp6!ZoX9e?FUfuqSsH^lUfm+ErMy?=W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zms5f_mfuFcUzkt zl12`xcm3Apb|VPmnj)7C{9`<^E4Pqcy-W1gHpj-|R|09C$4@MOFNU@lGcBi+PG z#tUKKd1gHJK*w8!toH;_9%6k>Atr766gV00F#_^lHa{1`j8%DCHH#?dHbPbUfvrz?=O(` zI}qh}0M1tv{Yd**$#_>0uK*q6@gC9foEj83X5V#=r0Ib zDx|T=u_&U=)~2E$`_7dyYRfC#vr6V50#&qTQ9%k5-KRpy zZv;)ux9iTp?f(qDhS&5r+jTSWAN>CJaP;{*!mAXVtQ?zsDrvpr6hf}dr4!12WL7RB zX^FWN-WJ`rZMLP^v`5CscnYX0vp`6iNkD&LrhrxDG_aIi(Af>|NfY zyK)=*2s#F!8wt7giq3{Sd&S_KH651_&!5{m5n;|23TEf_h8mvdj7el)JwOsCZ!VbV9a diff --git a/bin/thumbv8m.main-none-eabihf.a b/bin/thumbv8m.main-none-eabihf.a index 44380fb3b9f1e6deca43706f3a9e3c56761ade4d..6c523af38b31456d49f06089c336bac57483d99e 100644 GIT binary patch literal 2782 zcmb7F%}*Uw6hAWq6ev7C+DdCRy!Q%9L}s86#H5;n_6dfMrqINVd2e1B;5EFD%o~U% zCZ*9uS2i*J18y1@F1m4D7Osqo_8(|;#mdx#CK{U*f4@6(-y0^a#*^GR=XcJz=bU@b zy>~K~T>r+_`<+huIE}|(D969)^yG|oD0GU5iE)!--u2gW?#_0w=DX!ub-PsY4%_#hA3Qniz<1@3qp5qjqd%V?-OHusdln>nd(L>+vj6O$d%k-i z_3`aF^I`kX?fZWpbj`0ktr_N4=Lcrt!Qsl?2ZzK2sEN--b|s-jI}(Cjf^)x&t+jep5WqURH4l=J8EzGQ{ z>Y@bVRU?TAb*dG*Aq-V3)~M-pBowp)JWTX&rF^t}Jw3aczGzRr zBWEy!yGA;}&uR57h_I$3kRj$5sjhB?=|Ey$otrp^k%!Oh*CMlAo$I;9k{Bxb%-E8> zG`p}YZG9(}IxPCXjI3iP3vG#3to42HYp6QV z0GNNW2_RY0oxt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Jonas Schievink Date: Tue, 23 Nov 2021 15:19:37 +0100 Subject: [PATCH 4/4] Add comment --- asm.S | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/asm.S b/asm.S index b4d40548..0d078b37 100644 --- a/asm.S +++ b/asm.S @@ -94,6 +94,10 @@ Reset: #endif 4: + # Preserve `lr` and emit debuginfo that lets external tools restore it. + # This fixes unwinding past the `Reset` handler. + # See https://sourceware.org/binutils/docs/as/CFI-directives.html for an + # explanation of the directives. .cfi_def_cfa sp, 0 push {lr} .cfi_offset lr, 0