Skip to content

Commit 0367ad6

Browse files
committed
stm: Include libgcc for __aeabi_d2f and __aeabi_f2d functions.
Thanks to Dave Hylands for this.
1 parent 36b35c0 commit 0367ad6

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

stm/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ CFLAGS += -Os -DNDEBUG
3333
endif
3434

3535
LDFLAGS = --nostdlib -T stm32f405.ld
36+
LIBS = $(shell $(CC) -print-libgcc-file-name)
3637

3738
SRC_C = \
3839
main.c \
@@ -145,7 +146,7 @@ $(BUILD)/flash1.bin: $(BUILD)/flash.elf
145146

146147
$(BUILD)/flash.elf: $(OBJ)
147148
$(ECHO) "LINK $@"
148-
$(Q)$(LD) $(LDFLAGS) -o $@ $(OBJ)
149+
$(Q)$(LD) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
149150
$(Q)$(SIZE) $@
150151

151152
$(BUILD)/%.o: %.s

stm/main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,6 +1180,7 @@ int main(void) {
11801180
goto soft_reset;
11811181
}
11821182

1183+
/* now supplied by libgcc library
11831184
double __aeabi_f2d(float x) {
11841185
// TODO
11851186
return 0.0;
@@ -1189,6 +1190,7 @@ float __aeabi_d2f(double x) {
11891190
// TODO
11901191
return 0.0;
11911192
}
1193+
*/
11921194

11931195
double sqrt(double x) {
11941196
// TODO

0 commit comments

Comments
 (0)