diff --git a/conf/firmwares/rotorcraft.makefile b/conf/firmwares/rotorcraft.makefile index 067f1b1d83..9b6857bf81 100644 --- a/conf/firmwares/rotorcraft.makefile +++ b/conf/firmwares/rotorcraft.makefile @@ -69,6 +69,10 @@ endif # Systime # $(TARGET).srcs += mcu_periph/sys_time.c $(SRC_ARCH)/mcu_periph/sys_time_arch.c +ifeq ($(ARCH), linux) +# seems that we need to link against librt for glibc < 2.17 +$(TARGET).LDFLAGS += -lrt +endif # diff --git a/conf/firmwares/setup.makefile b/conf/firmwares/setup.makefile index cfe5d2669b..c234518ab4 100644 --- a/conf/firmwares/setup.makefile +++ b/conf/firmwares/setup.makefile @@ -30,6 +30,10 @@ ifneq ($(SYS_TIME_LED),none) endif COMMON_SETUP_CFLAGS += -DPERIODIC_FREQUENCY=$(PERIODIC_FREQUENCY) COMMON_SETUP_SRCS += mcu_periph/sys_time.c $(SRC_ARCH)/mcu_periph/sys_time_arch.c +ifeq ($(ARCH), linux) +# seems that we need to link against librt for glibc < 2.17 +$(TARGET).LDFLAGS += -lrt +endif COMMON_SETUP_CFLAGS += -DUSE_LED diff --git a/conf/firmwares/subsystems/fixedwing/autopilot.makefile b/conf/firmwares/subsystems/fixedwing/autopilot.makefile index d441cd60cd..2789f651c7 100644 --- a/conf/firmwares/subsystems/fixedwing/autopilot.makefile +++ b/conf/firmwares/subsystems/fixedwing/autopilot.makefile @@ -71,6 +71,10 @@ endif # Sys-time # $(TARGET).srcs += mcu_periph/sys_time.c $(SRC_ARCH)/mcu_periph/sys_time_arch.c +ifeq ($(ARCH), linux) +# seems that we need to link against librt for glibc < 2.17 +$(TARGET).LDFLAGS += -lrt +endif # # InterMCU & Commands diff --git a/conf/firmwares/test_progs.makefile b/conf/firmwares/test_progs.makefile index ce2d7906ab..7ae2ccf827 100644 --- a/conf/firmwares/test_progs.makefile +++ b/conf/firmwares/test_progs.makefile @@ -54,6 +54,10 @@ ifneq ($(SYS_TIME_LED),none) endif COMMON_TEST_CFLAGS += -DPERIODIC_FREQUENCY=$(PERIODIC_FREQUENCY) COMMON_TEST_SRCS += mcu_periph/sys_time.c $(SRC_ARCH)/mcu_periph/sys_time_arch.c +ifeq ($(ARCH), linux) +# seems that we need to link agains librt for glibc < 2.17 +$(TARGET).LDFLAGS += -lrt +endif COMMON_TEST_CFLAGS += -DUSE_LED