From 6562926cb8820cee9efe202b960955ce977a9ab0 Mon Sep 17 00:00:00 2001 From: Vincent Jardin Date: Mon, 11 Nov 2024 23:43:33 +0100 Subject: [PATCH] Makefile.am: fix non static linkage I do not understand why some -static are enforced while dynamic linkage could be used. --- cmdif/Makefile.am | 4 ++-- dev_mgt/Makefile.am | 4 ++-- flint/Makefile.am | 2 +- mlxconfig/Makefile.am | 2 +- mstdump/crd_main/Makefile.am | 2 +- mtcr_py/Makefile.am | 2 +- reg_access/Makefile.am | 4 ++-- resourcetools/resourcedump_lib/src/sdk/Makefile.am | 4 ++-- small_utils/Makefile.am | 14 +++++++------- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/cmdif/Makefile.am b/cmdif/Makefile.am index 7bb332aa..d3a8ec9a 100644 --- a/cmdif/Makefile.am +++ b/cmdif/Makefile.am @@ -53,7 +53,7 @@ libcmdif_la_SOURCES = tools_cif.c tools_cif.h icmd_cif_common.c icmd_cif_common. cmdif_pylibdir = $(libdir)/mstflint/python_tools/ cmdif_pylib_DATA = ${CCMDIF_SO} cmdif.py ${CCMDIF_SO}: libcmdif.la - $(CC) -g -Wall -pthread -shared ${CFLAGS} *.o -o ${CCMDIF_SO} \ - $(top_builddir)/tools_layouts/.libs/libtools_layouts.a $(top_builddir)/${MTCR_CONF_DIR}/.libs/libmtcr_ul.a + $(CC) -g -Wall -pthread -shared ${CFLAGS} .libs/*.o -o ${CCMDIF_SO} \ + $(top_builddir)/tools_layouts/.libs/libtools_layouts.a $(top_builddir)/${MTCR_CONF_DIR}/.libs/libmtcr_ul.so CLEANFILES = ${CCMDIF_SO} diff --git a/dev_mgt/Makefile.am b/dev_mgt/Makefile.am index a5f66e9f..40522343 100644 --- a/dev_mgt/Makefile.am +++ b/dev_mgt/Makefile.am @@ -50,9 +50,9 @@ dev_mgt_pylib_DATA = c_dev_mgt.so dist_dev_mgt_pylib_DATA = dev_mgt.py c_dev_mgt.so: libdev_mgt.la - $(CC) -g -Wall -pthread -shared ${CFLAGS} tools_dev_types.o -o c_dev_mgt.so \ + $(CC) -g -Wall -pthread -shared ${CFLAGS} .libs/tools_dev_types.o -o c_dev_mgt.so \ $(top_builddir)/reg_access/.libs/libreg_access.a \ $(top_builddir)/tools_layouts/.libs/libtools_layouts.a \ - $(top_builddir)/${MTCR_CONF_DIR}/.libs/libmtcr_ul.a + $(top_builddir)/${MTCR_CONF_DIR}/.libs/libmtcr_ul.so CLEANFILES = c_dev_mgt.so diff --git a/flint/Makefile.am b/flint/Makefile.am index d990b95a..26a200c6 100644 --- a/flint/Makefile.am +++ b/flint/Makefile.am @@ -71,7 +71,7 @@ mstflint_DEPENDENCIES = \ LDADD_mstflint = ${LDL} -mstflint_LDFLAGS = -static +#mstflint_LDFLAGS = -static if ENABLE_DC LDADD_mstflint += -lz diff --git a/mlxconfig/Makefile.am b/mlxconfig/Makefile.am index ac2d3459..42d48345 100755 --- a/mlxconfig/Makefile.am +++ b/mlxconfig/Makefile.am @@ -98,7 +98,7 @@ mstconfig_DEPENDENCIES = \ mstconfig_LDADD = $(mstconfig_DEPENDENCIES) ${LDL} -mstconfig_LDFLAGS = -static +#mstconfig_LDFLAGS = -static if DISABLE_XML2 AM_CXXFLAGS += -DDISABLE_XML2 diff --git a/mstdump/crd_main/Makefile.am b/mstdump/crd_main/Makefile.am index 6fd2abb1..8b521f23 100755 --- a/mstdump/crd_main/Makefile.am +++ b/mstdump/crd_main/Makefile.am @@ -39,5 +39,5 @@ bin_PROGRAMS = mstregdump mstregdump_SOURCES = mstdump.c mstregdump_LDADD = ../crd_lib/libcrdump.a ../../dev_mgt/libdev_mgt.la ../../reg_access/libreg_access.la ../../tools_layouts/libtools_layouts.la \ ../../${MTCR_CONF_DIR}/libmtcr_ul.la -lm ${LDL} -mstregdump_LDFLAGS = -static +#mstregdump_LDFLAGS = -static mstregdump_CFLAGS = -DMSTDUMP_NAME=\"mstregdump\" -DDEV_EXAMPLE=\"0b:00.0\" diff --git a/mtcr_py/Makefile.am b/mtcr_py/Makefile.am index 46fa4e60..3b847dcf 100644 --- a/mtcr_py/Makefile.am +++ b/mtcr_py/Makefile.am @@ -35,6 +35,6 @@ mtcr_pylibdir = $(libdir)/mstflint/python_tools/ mtcr_pylib_DATA = cmtcr.so dist_mtcr_pylib_DATA = mtcr.py cmtcr.so: - $(CC) -g -Wall -pthread -shared ${CFLAGS} -o cmtcr.so -Wl,--whole-archive $(top_builddir)/${MTCR_CONF_DIR}/.libs/libmtcr_ul.a -Wl,--no-whole-archive + $(CC) -g -Wall -pthread -shared ${CFLAGS} -o cmtcr.so $(top_builddir)/${MTCR_CONF_DIR}/.libs/libmtcr_ul.so CLEANFILES = cmtcr.so diff --git a/reg_access/Makefile.am b/reg_access/Makefile.am index 8e38c473..45068a19 100644 --- a/reg_access/Makefile.am +++ b/reg_access/Makefile.am @@ -57,7 +57,7 @@ reg_access_pylib_DATA = ${RREG_ACCESS_SO} dist_reg_access_pylib_DATA = regaccess.py regaccess_hca_ext_structs.py regaccess_switch_ext_structs.py ${RREG_ACCESS_SO}: libreg_access.la - $(CC) -g -Wall -pthread -shared ${CFLAGS} *.o -o ${RREG_ACCESS_SO} \ - $(top_builddir)/tools_layouts/.libs/libtools_layouts.a $(top_builddir)/${MTCR_CONF_DIR}/.libs/libmtcr_ul.a + $(CC) -g -Wall -pthread -shared ${CFLAGS} .libs/*.o -o ${RREG_ACCESS_SO} \ + $(top_builddir)/tools_layouts/.libs/libtools_layouts.a $(top_builddir)/${MTCR_CONF_DIR}/.libs/libmtcr_ul.so CLEANFILES = ${RREG_ACCESS_SO} diff --git a/resourcetools/resourcedump_lib/src/sdk/Makefile.am b/resourcetools/resourcedump_lib/src/sdk/Makefile.am index aefc88a4..76619f59 100644 --- a/resourcetools/resourcedump_lib/src/sdk/Makefile.am +++ b/resourcetools/resourcedump_lib/src/sdk/Makefile.am @@ -63,7 +63,7 @@ libraryinclude_HEADERS = \ # if WIN_BUILD # MTCR_LIB = $(MTCR_DIR)/.libs/libmtcr.dll.a # else -MTCR_LIB = $(top_builddir)/${MTCR_CONF_DIR}/.libs/libmtcr_ul.a +MTCR_LIB = $(top_builddir)/${MTCR_CONF_DIR}/.libs/libmtcr_ul.so # endif if ENABLE_RDMEM @@ -86,7 +86,7 @@ resource_dump_sdk_so_DEPS = \ # if !WIN_BUILD libresource_dump_sdk.so: libresource_dump_sdk.la - $(CC) -Wall -pthread -shared ${CFLAGS} $(COMPILER_FPIC) libresource_dump_sdk_la-resource_dump_sdk.o \ + $(CC) -Wall -pthread -shared ${CFLAGS} $(COMPILER_FPIC) .libs/libresource_dump_sdk_la-resource_dump_sdk.o \ -o libresource_dump_sdk.so ${AM_LDFLAGS} $(resource_dump_sdk_so_DEPS) # else # libresource_dump_sdk.dll: libresource_dump_sdk.la diff --git a/small_utils/Makefile.am b/small_utils/Makefile.am index 4da2b6a4..00e26b9d 100644 --- a/small_utils/Makefile.am +++ b/small_utils/Makefile.am @@ -47,12 +47,12 @@ bin_SCRIPTS = mstfwreset mstmread_SOURCES = mread.c mstmread_DEPENDENCIES = $(top_builddir)/${MTCR_CONF_DIR}/libmtcr_ul.la mstmread_LDADD = $(mstmread_DEPENDENCIES) ${LDL} -mstmread_LDFLAGS = -static +#mstmread_LDFLAGS = -static mstmwrite_SOURCES = mwrite.c mstmwrite_DEPENDENCIES = $(top_builddir)/${MTCR_CONF_DIR}/libmtcr_ul.la mstmwrite_LDADD = $(mstmwrite_DEPENDENCIES) ${LDL} -mstmwrite_LDFLAGS = -static +#mstmwrite_LDFLAGS = -static mstvpd_SOURCES = vpd.c mstvpd_DEPENDENCIES = $(top_builddir)/mvpd/libmvpd.la \ @@ -61,7 +61,7 @@ mstvpd_DEPENDENCIES = $(top_builddir)/mvpd/libmvpd.la \ $(top_builddir)/reg_access/libreg_access.la \ $(top_builddir)/tools_layouts/libtools_layouts.la mstvpd_LDADD = $(mstvpd_DEPENDENCIES) ${LDL} -mstvpd_LDFLAGS = -static +#mstvpd_LDFLAGS = -static mstcongestion_SOURCES = congestion.cpp mstcongestion_DEPENDENCIES = $(top_builddir)/cmdif/libcmdif.la \ @@ -71,12 +71,12 @@ mstcongestion_DEPENDENCIES = $(top_builddir)/cmdif/libcmdif.la \ $(top_builddir)/cmdparser/libcmdparser.a \ $(top_builddir)/${MTCR_CONF_DIR}/libmtcr_ul.la mstcongestion_LDADD = $(mstcongestion_DEPENDENCIES) ${LDL} -mstcongestion_LDFLAGS = -static +#mstcongestion_LDFLAGS = -static mstmcra_SOURCES = mcra.c mstmcra_DEPENDENCIES = $(top_builddir)/${MTCR_CONF_DIR}/libmtcr_ul.la mstmcra_LDADD = $(mstmcra_DEPENDENCIES) ${LDL} -mstmcra_LDFLAGS = -static +#mstmcra_LDFLAGS = -static if LINUX_BUILD bin_PROGRAMS += mstfwctrl @@ -86,14 +86,14 @@ mstfwctrl_DEPENDENCIES = $(top_builddir)/${MTCR_CONF_DIR}/libmtcr_ul.la \ $(top_builddir)/dev_mgt/libdev_mgt.la \ $(top_builddir)/reg_access/libreg_access.la mstfwctrl_LDADD = $(mstfwctrl_DEPENDENCIES) ${LDL} -mstfwctrl_LDFLAGS = -static +#mstfwctrl_LDFLAGS = -static endif mstmtserver_SOURCES = mtserver.c tcp.c tcp.h mstmtserver_CFLAGS = -DMST_UL mstmtserver_DEPENDENCIES = $(top_builddir)/${MTCR_CONF_DIR}/libmtcr_ul.la mstmtserver_LDADD = $(mstmtserver_DEPENDENCIES) ${LDL} -mstmtserver_LDFLAGS = -static +#mstmtserver_LDFLAGS = -static SUBDIRS = mlxfwresetlib MSTFWRESET_PYTHON_WRAPPER=mstfwreset