diff --git a/src/hal/Submakefile b/src/hal/Submakefile index 8b7e42bac14..290a0095858 100644 --- a/src/hal/Submakefile +++ b/src/hal/Submakefile @@ -2,10 +2,14 @@ HALLIBSRCS := hal/hal_lib.c hal/hal_lib_query.c hal/hal_lib_extra.c $(ULAPISRCS) $(call TOOBJSDEPS, $(HALLIBSRCS)): EXTRAFLAGS += -fPIC $(ULAPI_CFLAGS) USERSRCS += $(HALLIBSRCS) +HALLIB_LIBS := ifeq ($(BUILD_SYS),uspace) -HALLIB_LIBS := -pthread -lrt -else -HALLIB_LIBS := -lrt +HALLIB_LIBS += -pthread +endif + +# Darwin supplies the timing functions through libSystem. +ifeq ($(filter darwin% macos%,$(HOST_OS)),) +HALLIB_LIBS += -lrt endif HALLIB := ../lib/liblinuxcnchal.so