Skip to content

Commit

Permalink
target: introduce HAVE_SHLIB variable
Browse files Browse the repository at this point in the history
JIRA: RTOS-664
  • Loading branch information
badochov committed Oct 6, 2024
1 parent 03a9b13 commit 49d2af8
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions makes/binary-dyn.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
# - DEP_LIBS_SHARED - shared libraries from current repo needed to be compiled/installed before this component (shortcut for putting something in LIBS and DEPS)
# - LIBS_SHARED - names of the shared libs to link the binary against (without .so suffix)

ifeq (${HAVE_SHLIB},n)
$(warning "binary-dyn.mk called on target not supporting dynamic linking!")
endif

RESOLVED_LIBS_SHARED := $(patsubst lib%,-l%, $(DEP_LIBS_SHARED) $(LIBS_SHARED))

DEPS += $(DEP_LIBS_SHARED)
Expand Down
6 changes: 6 additions & 0 deletions makes/check-env.mk
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,9 @@ ifeq ($(HAVE_MMU), n)
$(error "KERNEL_PHADDR is not set for NOMMU target, please check project configuration")
endif
endif

ifeq ($(HAVE_SHLIB), n)
ifeq ($(LIBPHOENIX_SHARED), y)
$(error "LIBPHOENIX_SHARED is set for target without shared lib support, please check project configuration")
endif
endif
3 changes: 3 additions & 0 deletions makes/shared-lib.mk
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
#
# - LOCAL_INSTALL_PATH - custom rootfs dir for the shared library to be installed (if not provided - DEFAULT_INSTALL_PATH_SO)

ifeq (${HAVE_SHLIB},n)
$(warning "shared-lib.mk called on target not supporting shared libraries!")
endif

# directory with current Makefile - relative to the repository root
# filter-out all Makefiles outside of TOPDIR
Expand Down
1 change: 1 addition & 0 deletions target/armv7a.mk
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@ LIBPHOENIX_PIC ?= y
LIBPHOENIX_SHARED ?= y

HAVE_MMU := y
HAVE_SHLIB := y
1 change: 1 addition & 0 deletions target/armv7m.mk
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,4 @@ OBJCOPY := $(CROSS)objcopy
OBJDUMP := $(CROSS)objdump

HAVE_MMU := n
HAVE_SHLIB := n
1 change: 1 addition & 0 deletions target/armv8m.mk
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@ OBJCOPY := $(CROSS)objcopy
OBJDUMP := $(CROSS)objdump

HAVE_MMU := n
HAVE_SHLIB := n
1 change: 1 addition & 0 deletions target/armv8r.mk
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ OBJCOPY := $(CROSS)objcopy
OBJDUMP := $(CROSS)objdump

HAVE_MMU := n
HAVE_SHLIB := n
1 change: 1 addition & 0 deletions target/ia32.mk
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ LIBPHOENIX_PIC ?= y
LIBPHOENIX_SHARED ?= y

HAVE_MMU := y
HAVE_SHLIB := y
1 change: 1 addition & 0 deletions target/riscv64.mk
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ LIBPHOENIX_PIC ?= y
LIBPHOENIX_SHARED ?= y

HAVE_MMU := y
HAVE_SHLIB := y
3 changes: 3 additions & 0 deletions target/sparcv8leon3.mk
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ ifeq ($(TARGET_SUBFAMILY), gr716)
endif

HAVE_MMU := n
HAVE_SHLIB := n

else ifeq ($(TARGET_SUBFAMILY), gr712rc)
ifeq ($(KERNEL), 1)
Expand All @@ -52,6 +53,7 @@ else ifeq ($(TARGET_SUBFAMILY), gr712rc)
LIBPHOENIX_SHARED ?= n

HAVE_MMU := y
HAVE_SHLIB := n
else ifeq ($(TARGET_SUBFAMILY), generic)
ifeq ($(KERNEL), 1)
CFLAGS +=
Expand All @@ -69,6 +71,7 @@ else ifeq ($(TARGET_SUBFAMILY), generic)
LIBPHOENIX_SHARED ?= n

HAVE_MMU := y
HAVE_SHLIB := n
else
$(error Incorrect TARGET.)
endif
Expand Down

0 comments on commit 49d2af8

Please sign in to comment.