mirror of
				https://github.com/Mbed-TLS/mbedtls.git
				synced 2025-10-30 10:45:34 +03:00 
			
		
		
		
	Merge pull request #7684 from daverodgman/armclang-fix-2.28
2.28 backport - Fix armclang compile fail
This commit is contained in:
		
							
								
								
									
										5
									
								
								ChangeLog.d/armclang-compile-fix.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								ChangeLog.d/armclang-compile-fix.txt
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | |||||||
|  | Bugfix | ||||||
|  |    * Fix clang and armclang compilation error when targeting certain Arm | ||||||
|  |      M-class CPUs (Cortex-M0, Cortex-M0+, Cortex-M1, Cortex-M23, | ||||||
|  |      SecurCore SC000). Fixes #1077. | ||||||
|  |  | ||||||
| @@ -677,6 +677,15 @@ | |||||||
| #if defined(__arm__) && !defined(MULADDC_CANNOT_USE_R7) | #if defined(__arm__) && !defined(MULADDC_CANNOT_USE_R7) | ||||||
|  |  | ||||||
| #if defined(__thumb__) && !defined(__thumb2__) | #if defined(__thumb__) && !defined(__thumb2__) | ||||||
|  | #if !defined(__ARMCC_VERSION) && !defined(__clang__) \ | ||||||
|  |     && !defined(__llvm__) && !defined(__INTEL_COMPILER) | ||||||
|  | /* | ||||||
|  |  * Thumb 1 ISA. This code path has only been tested successfully on gcc; | ||||||
|  |  * it does not compile on clang or armclang. | ||||||
|  |  * | ||||||
|  |  * Other compilers which define __GNUC__ may not work. The above macro | ||||||
|  |  * attempts to exclude these untested compilers. | ||||||
|  |  */ | ||||||
|  |  | ||||||
| #define MULADDC_INIT                                    \ | #define MULADDC_INIT                                    \ | ||||||
|     asm(                                                \ |     asm(                                                \ | ||||||
| @@ -731,6 +740,8 @@ | |||||||
|            "r6", "r7", "r8", "r9", "cc"         \ |            "r6", "r7", "r8", "r9", "cc"         \ | ||||||
|          ); |          ); | ||||||
|  |  | ||||||
|  | #endif /* Compiler is gcc */ | ||||||
|  |  | ||||||
| #elif (__ARM_ARCH >= 6) && \ | #elif (__ARM_ARCH >= 6) && \ | ||||||
|     defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1) |     defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -3156,6 +3156,25 @@ component_build_arm_none_eabi_gcc_no_64bit_multiplication () { | |||||||
|     not grep __aeabi_lmul library/*.o |     not grep __aeabi_lmul library/*.o | ||||||
| } | } | ||||||
|  |  | ||||||
|  | component_build_arm_clang_thumb () { | ||||||
|  |     # ~ 30s | ||||||
|  |  | ||||||
|  |     scripts/config.py baremetal | ||||||
|  |  | ||||||
|  |     msg "build: clang thumb 2, make" | ||||||
|  |     make clean | ||||||
|  |     make CC="clang" CFLAGS='-std=c99 -Werror -Os --target=arm-linux-gnueabihf -march=armv7-m -mthumb' lib | ||||||
|  |  | ||||||
|  |     # Some Thumb 1 asm is sensitive to optimisation level, so test both -O0 and -Os | ||||||
|  |     msg "build: clang thumb 1 -O0, make" | ||||||
|  |     make clean | ||||||
|  |     make CC="clang" CFLAGS='-std=c99 -Werror -O0 --target=arm-linux-gnueabihf -mcpu=arm1136j-s -mthumb' lib | ||||||
|  |  | ||||||
|  |     msg "build: clang thumb 1 -Os, make" | ||||||
|  |     make clean | ||||||
|  |     make CC="clang" CFLAGS='-std=c99 -Werror -Os --target=arm-linux-gnueabihf -mcpu=arm1136j-s -mthumb' lib | ||||||
|  | } | ||||||
|  |  | ||||||
| component_build_armcc () { | component_build_armcc () { | ||||||
|     msg "build: ARM Compiler 5" |     msg "build: ARM Compiler 5" | ||||||
|     scripts/config.py baremetal |     scripts/config.py baremetal | ||||||
| @@ -3166,6 +3185,8 @@ component_build_armcc () { | |||||||
|  |  | ||||||
|     make clean |     make clean | ||||||
|  |  | ||||||
|  |     # Compile mostly with -O1 since some Arm inline assembly is disabled for -O0. | ||||||
|  |  | ||||||
|     # ARM Compiler 6 - Target ARMv7-A |     # ARM Compiler 6 - Target ARMv7-A | ||||||
|     armc6_build_test "--target=arm-arm-none-eabi -march=armv7-a" |     armc6_build_test "--target=arm-arm-none-eabi -march=armv7-a" | ||||||
|  |  | ||||||
| @@ -3180,7 +3201,14 @@ component_build_armcc () { | |||||||
|  |  | ||||||
|     # ARM Compiler 6 - Target ARMv8-A - AArch64 |     # ARM Compiler 6 - Target ARMv8-A - AArch64 | ||||||
|     armc6_build_test "--target=aarch64-arm-none-eabi -march=armv8.2-a" |     armc6_build_test "--target=aarch64-arm-none-eabi -march=armv8.2-a" | ||||||
|  |  | ||||||
|  |     # ARM Compiler 6 - Target Cortex-M0 - no optimisation | ||||||
|  |     armc6_build_test "-O0 --target=arm-arm-none-eabi -mcpu=cortex-m0" | ||||||
|  |  | ||||||
|  |     # ARM Compiler 6 - Target Cortex-M0 | ||||||
|  |     armc6_build_test "-Os --target=arm-arm-none-eabi -mcpu=cortex-m0" | ||||||
| } | } | ||||||
|  |  | ||||||
| support_build_armcc () { | support_build_armcc () { | ||||||
|     armc5_cc="$ARMC5_BIN_DIR/armcc" |     armc5_cc="$ARMC5_BIN_DIR/armcc" | ||||||
|     armc6_cc="$ARMC6_BIN_DIR/armclang" |     armc6_cc="$ARMC6_BIN_DIR/armclang" | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user