Advertisement
uaa

[wip:20220306] OpenGD77 for LLVM/Clang

uaa
Mar 5th, 2022
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1. diff -ru OpenGD77.orig/firmware/Makefile OpenGD77/firmware/Makefile
  2. --- OpenGD77.orig/firmware/Makefile 2021-07-10 16:39:42.000000000 +0900
  3. +++ OpenGD77/firmware/Makefile 2022-03-06 19:14:29.061289991 +0900
  4. @@ -171,7 +171,7 @@
  5. ALL_SRC := $(SRC) $(OS_SRC) $(DEVICE_SRC) $(DRIVERS_SRC)
  6. CONFIGS := $(TARGET) -Wall -fno-common -g3 -ffunction-sections \
  7. -fdata-sections -ffreestanding -fno-builtin \
  8. - -fmerge-constants -fstack-usage
  9. +# -fmerge-constants -fstack-usage
  10.  
  11. REDLIB := 0
  12. ifeq ($(REDLIB), 1)
  13. @@ -200,7 +200,7 @@
  14. OZERO_OBJECTS := $(addprefix $(BUILD_DIR)/, $(addsuffix .o, $(basename $(OZERO_SOURCES))))
  15.  
  16. CFLAGS := $(ALL_INC) -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb $(CONFIGS) \
  17. - $(DEFINES) $(EXCEPT) -c
  18. + $(DEFINES) $(EXCEPT) -c --target=arm-none-eabi -I/usr/arm-none-eabi/include
  19.  
  20. AFLAGS := -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb
  21. LFLAGS := -nostdlib -Xlinker -Map="firmware.map" -Xlinker --gc-sections -Xlinker \
  22. @@ -211,7 +211,7 @@
  23.  
  24. LINK_LIBS := $(LIBS)
  25.  
  26. -CC := arm-none-eabi-gcc
  27. +CC := clang
  28. AS := arm-none-eabi-as
  29. CP := arm-none-eabi-objcopy
  30. SZ := arm-none-eabi-size
  31. diff -ru OpenGD77.orig/firmware/include/dmr_codec/codec.h OpenGD77/firmware/include/dmr_codec/codec.h
  32. --- OpenGD77.orig/firmware/include/dmr_codec/codec.h 2021-07-10 16:39:42.000000000 +0900
  33. +++ OpenGD77/firmware/include/dmr_codec/codec.h 2022-03-06 19:21:26.236296961 +0900
  34. @@ -41,7 +41,7 @@
  35. #define AMBE_ENCODE_ECC 0x00054228;
  36. */
  37.  
  38. -#define AMBE_DECODE 0x0005543D;
  39. +#define AMBE_DECODE 0x0005543C;
  40. #define AMBE_ENCODE 0x00054F94;
  41. #define AMBE_ENCODE_ECC 0x0005534C;
  42.  
  43. diff -ru OpenGD77.orig/firmware/source/semihost_hardfault.c OpenGD77/firmware/source/semihost_hardfault.c
  44. --- OpenGD77.orig/firmware/source/semihost_hardfault.c 2021-07-10 16:39:42.000000000 +0900
  45. +++ OpenGD77/firmware/source/semihost_hardfault.c 2022-03-06 19:37:39.115313214 +0900
  46. @@ -102,7 +102,12 @@
  47. "STR R1,[ R0,#0 ] \n" // R0 is at location 0 on stack
  48. // Return from hard fault handler to application
  49. "BX LR \n"
  50. - ".syntax divided\n") ;
  51. +#if defined(__clang__)
  52. + // LLVM/Clang: unified syntax only
  53. +#else
  54. + ".syntax divided\n"
  55. +#endif
  56. + ) ;
  57. }
  58.  
  59. #endif
  60.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement