Skip to contentSkip to conversation

Makefile: remove static linking in Linux build

PATCH In review Jianxun Zhang 2 participants 4 messages Aug 26, 2016 – Aug 29, 2016 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: remove static linking in Linux build

The removed static linking was for a desire to make rmc run on systems where c libraries are not provided.

But it is nothing wrong to dynamically link rmc with libraries. We also don't have to hardcode the way of linking in Makefile since people can specify it in RMC_CFLAGS passed to make command.

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index e873af6..f152829 100644
@@ -17,7 +17,7 @@ RMC_INSTALL_BIN_PATH := $(RMC_INSTALL_PREFIX)/bin/
 
 ALL_OBJS := $(RMC_TOOL_OBJ) $(RMCL_OBJ) $(RSMP_OBJ)
 
-CFLAGS := -static -Wall -O2 -Iinc $(RMC_CFLAGS)
+CFLAGS := -Wall -O2 -Iinc $(RMC_CFLAGS)
 
 all: rmc librmcl librsmp
 
Signature · 1 line
2.7.4
#1 lore raw
Quoted 7 lines · Jianxun Zhang

The removed static linking was for a desire to make rmc run on systems where c libraries are not provided.

But it is nothing wrong to dynamically link rmc with libraries. We also don't have to hardcode the way of linking in Makefile since people can specify it in RMC_CFLAGS passed to make command.

have you tested the dynamic version ?

Quoted 19 lines
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index e873af6..f152829 100644
@@ -17,7 +17,7 @@ RMC_INSTALL_BIN_PATH := $(RMC_INSTALL_PREFIX)/bin/
 
 ALL_OBJS := $(RMC_TOOL_OBJ) $(RMCL_OBJ) $(RSMP_OBJ)
 
-CFLAGS := -static -Wall -O2 -Iinc $(RMC_CFLAGS)
+CFLAGS := -Wall -O2 -Iinc $(RMC_CFLAGS)
 
 all: rmc librmcl librsmp
 
#2 lore raw
Quoted 9 lines · Khem Raj
Quoted 3 lines · Jianxun Zhang

The removed static linking was for a desire to make rmc run on systems where c libraries are not provided.

Quoted 6 lines
Quoted 4 lines

But it is nothing wrong to dynamically link rmc with libraries. We also don't have to hardcode the way of linking in Makefile since people can specify it in RMC_CFLAGS passed to make command.

have you tested the dynamic version ?

Khem,

In RMC, two different test stages are defined in workflow. Please refer to "Patch submission & Maintenance” in README in rmc project.

This patch to upstream rmc project was tested against rmc internal test suite (1st test stage) with yocto minimal images, RMC binaries built with the image, and another pending hash-style patch in recipe. See below.

A QA checker of hash style in OE will fail once the --static is gone because it only expects gnu_hash for SYMTAB in dynamic section in ELF. The patch of hash issue in rmc recipe is under test (2nd test stage) with builtin examples in meta-intel for the next rmc revision update. This fix for an OE-specifc enforcement should be another step beyond this upstream patch’s submission and rmc project.

But I probably should mention it in submission for a better clarity. Hope the info could help. Feel free to let me know anything I missed.

Thanks!

Quoted 20 lines
Quoted 20 lines

---
Makefile | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index e873af6..f152829 100644
@@ -17,7 +17,7 @@ RMC_INSTALL_BIN_PATH := $(RMC_INSTALL_PREFIX)/bin/
 
 ALL_OBJS := $(RMC_TOOL_OBJ) $(RMCL_OBJ) $(RSMP_OBJ)
 
-CFLAGS := -static -Wall -O2 -Iinc $(RMC_CFLAGS)
+CFLAGS := -Wall -O2 -Iinc $(RMC_CFLAGS)
 

all: rmc librmcl librsmp

#3 lore raw
Quoted 17 lines · Jianxun Zhang
Quoted 15 lines · Khem Raj
Quoted 7 lines · Jianxun Zhang

The removed static linking was for a desire to make rmc run on systems where c libraries are not provided.

But it is nothing wrong to dynamically link rmc with libraries. We also don't have to hardcode the way of linking in Makefile since people can specify it in RMC_CFLAGS passed to make command.

Quoted 4 lines
Quoted 1 line

have you tested the dynamic version ?

Khem,

In RMC, two different test stages are defined in workflow. Please refer to "Patch submission & Maintenance” in README in rmc project.

Khem,
And the information I referred to in README is in “rmc-dev” branch now.
http://git.yoctoproject.org/cgit/cgit.cgi/rmc/commit/?h=rmc-dev&id=b22169ae5c2462601646cca186e1b42ddfcdb6b0

Quoted 40 lines

This patch to upstream rmc project was tested against rmc internal test suite (1st test stage) with yocto minimal images, RMC binaries built with the image, and another pending hash-style patch in recipe. See below.

A QA checker of hash style in OE will fail once the --static is gone because it only expects gnu_hash for SYMTAB in dynamic section in ELF. The patch of hash issue in rmc recipe is under test (2nd test stage) with builtin examples in meta-intel for the next rmc revision update. This fix for an OE-specifc enforcement should be another step beyond this upstream patch’s submission and rmc project.

But I probably should mention it in submission for a better clarity. Hope the info could help. Feel free to let me know anything I missed.

Thanks!

Quoted 20 lines
Quoted 20 lines

---
Makefile | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index e873af6..f152829 100644
@@ -17,7 +17,7 @@ RMC_INSTALL_BIN_PATH := $(RMC_INSTALL_PREFIX)/bin/
 
 ALL_OBJS := $(RMC_TOOL_OBJ) $(RMCL_OBJ) $(RSMP_OBJ)
 
-CFLAGS := -static -Wall -O2 -Iinc $(RMC_CFLAGS)
+CFLAGS := -Wall -O2 -Iinc $(RMC_CFLAGS)
 

all: rmc librmcl librsmp

Signature · 4 lines
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto