Skip to contentSkip to conversation

makefile: fail to compile if there are more than one exported symbols.

PATCH New Lidong Zhong 2 participants 7 messages Jun 12, 2015 – Jun 16, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 makefile: fail to compile if there are more than one exported symbols.

---
 make.tmpl.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
make.tmpl.in +1 -1
index 731dab7..60ddd01 100644
@@ -499,7 +499,7 @@ ifeq (,$(firstword $(EXPORTED_SYMBOLS)))
 		 echo "	local:"; echo "		*;"; echo "};") > $@
 else
 	set -e;\
-	R=$$(sort $^ | uniq -u);\
+	R="$$(sort $^ | uniq -u)";\
 	test -z "$$R" || { echo "Mismatch between symbols in shared library and lists in .exported_symbols.* files: $$R"; false; } ;\
 	for i in $(EXPORTED_SYMBOLS); do\
 		echo "$${i##*.} {"; echo "	global:";\
Signature · 1 line
1.8.1.4
#1 lore raw

PATCH 1/1 makefile: fail to compile if there are more than one exported symbols.

Dne 12.6.2015 v 09:33 Lidong Zhong napsal(a):

Quoted 9 lines
---
  make.tmpl.in | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
make.tmpl.in +0 -0
index 731dab7..60ddd01 100644

make.tmpl.in ifeq (,$(firstword $(EXPORTED_SYMBOLS))) · line 505

Quoted 8 lines
make.tmpl.in +1 -1
@@ -499,7 +499,7 @@ ifeq (,$(firstword $(EXPORTED_SYMBOLS)))
  		 echo "	local:"; echo "		*;"; echo "};") > $@
  else
  	set -e;\
-	R=$$(sort $^ | uniq -u);\
+	R="$$(sort $^ | uniq -u)";\
  	test -z "$$R" || { echo "Mismatch between symbols in shared library and lists in .exported_symbols.* files: $$R"; false; } ;\
  	for i in $(EXPORTED_SYMBOLS); do\
  		echo "$${i##*.} {"; echo "	global:";\

Hi

Do you have some example where it fails without "" ? Bash normally should assign $VARS directly.

Zdenek

#2 lore raw

PATCH 1/1 makefile: fail to compile if there are more than one exported symbols.

Quoted 1 line
Quoted 1 line
Quoted 1 line

On 6/12/2015 at 11:51 PM, in message <[email protected]>, Zdenek

Quoted 17 lines · Kabelac

Dne 12.6.2015 v 09:33 Lidong Zhong napsal(a):

Quoted 9 lines

---

  make.tmpl.in | 2 +- 
  1 file changed, 1 insertion(+), 1 deletion(-) 
make.tmpl.in +0 -0
index 731dab7..60ddd01 100644 

make.tmpl.in ifeq (,$(firstword $(EXPORTED_SYMBOLS))) · line 503

Quoted 6 lines
make.tmpl.in +1 -1
@@ -499,7 +499,7 @@ ifeq (,$(firstword $(EXPORTED_SYMBOLS))) 
  		 echo "	local:"; echo "		*;"; echo "};") > $@ 
  else 
  	set -e;\ 
-	R=$$(sort $^ | uniq -u);\ 
+	R="$$(sort $^ | uniq -u)";\ 
  	test -z "$$R" || { echo "Mismatch between symbols in shared library and  

lists in .exported_symbols.* files: $$R"; false; } ;\

Quoted 7 lines

make.tmpl.in ifeq (,$(firstword $(EXPORTED_SYMBOLS))) · line 505

Quoted 2 lines
make.tmpl.in +0 -0
  	for i in $(EXPORTED_SYMBOLS); do\ 
  		echo "$${i##*.} {"; echo "	global:";\ 

Hi

Do you have some example where it fails without "" ? Bash normally should assign $VARS directly.

Hi Zdenek,

As the echo outputs, if there are more symbols got from sort $^ | uniq -u, there will be an bash error.
I found this exactly because I forgot to add these symbols to .exported_symbols.* files.

Regards,
Lidong

Quoted 12 lines

Zdenek

Signature · 3 lines
lvm-devel mailing list 
lvm-devel at redhat.com 
https://www.redhat.com/mailman/listinfo/lvm-devel 
#3 lore raw

PATCH 1/1 makefile: fail to compile if there are more than one exported symbols.

Dne 15.6.2015 v 04:58 Lidong Zhong napsal(a):

Quoted 24 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

On 6/12/2015 at 11:51 PM, in message <[email protected]>, Zdenek

Quoted 22 lines · Kabelac

Dne 12.6.2015 v 09:33 Lidong Zhong napsal(a):

Quoted 9 lines
---
   make.tmpl.in | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
make.tmpl.in +0 -0
index 731dab7..60ddd01 100644

make.tmpl.in ifeq (,$(firstword $(EXPORTED_SYMBOLS))) · line 503

Quoted 6 lines
make.tmpl.in +1 -1
@@ -499,7 +499,7 @@ ifeq (,$(firstword $(EXPORTED_SYMBOLS)))
   		 echo "	local:"; echo "		*;"; echo "};") > $@
   else
   	set -e;\
-	R=$$(sort $^ | uniq -u);\
+	R="$$(sort $^ | uniq -u)";\
   	test -z "$$R" || { echo "Mismatch between symbols in shared library and

lists in .exported_symbols.* files: $$R"; false; } ;\

make.tmpl.in ifeq (,$(firstword $(EXPORTED_SYMBOLS))) · line 505

Quoted 2 lines
make.tmpl.in +0 -0
   	for i in $(EXPORTED_SYMBOLS); do\
   		echo "$${i##*.} {"; echo "	global:";\

Hi

Quoted 7 lines
Quoted 2 lines

Do you have some example where it fails without "" ? Bash normally should assign $VARS directly.

Hi Zdenek,

As the echo outputs, if there are more symbols got from sort $^ | uniq -u, there will be an bash error.
I found this exactly because I forgot to add these symbols to .exported_symbols.* files.

But the bash error here is wanted when symbols are missing - it's the purpose to stop compilation. So please specify more closely the example where it fails because of missing "".

This output is wanted:

Mismatch between symbols in shared library and lists in .exported_symbols.*
files: dm_tree_node_set_XXXX
dm_tree_node_set_YYYY
../make.tmpl:501: recipe for target '.export.sym' failed
make: *** [.export.sym] Error 1

If the dm_tree_node_set_XXXX|YYYY is not defined in any .exported_symbols*

Zdenek

#4 lore raw

PATCH 1/1 makefile: fail to compile if there are more than one exported symbols.

Hi ,

Without this patch, I would get the following error:

set -e;\
R=dm_lv_simple_resume dm_lv_simple_suspend dm_replace_mirror_table;\
test -z "$R" || { echo "Mismatch between symbols in shared library and lists in .exported_symbols.* files: $R"; false; } ;\

(for i in ./.exported_symbols.Base ./.exported_symbols.DM_1_02_97 ; do\
	echo "${i##*.} {"; echo "	global:";\
	/usr/bin/sed "s/^/		/;s/$/;/" < $i;\
	test "$i" = Base && { echo "	local:"; echo "		*;"; };\
	echo "};";\

done ) > .export.sym
/bin/sh: line 1: dm_lv_simple_suspend: command not found ../make.tmpl:508: recipe for target '.export.sym' failed make[1]: *** [.export.sym] Error 127
make[1]: Leaving directory '/home/lwang/LVM2.2.02.120/libdm' make.tmpl:323: recipe for target 'libdm.device-mapper' failed
make: *** [libdm.device-mapper] Error 2

Regards,
Lidong

Quoted 32 lines
Quoted 3 lines

Hi Zdenek,

As the echo outputs, if there are more symbols got from `sort $^ | uniq

-u`, there will be

Quoted 2 lines

an bash error.
I found this exactly because I forgot to add these symbols to

.exported_symbols.* files.

But the bash error here is wanted when symbols are missing - it's the purpose

to stop compilation. So please specify more closely the example where it fails
because of missing "".

This output is wanted:

Mismatch between symbols in shared library and lists in .exported_symbols.*
files: dm_tree_node_set_XXXX
dm_tree_node_set_YYYY
../make.tmpl:501: recipe for target '.export.sym' failed
make: *** [.export.sym] Error 1

If the dm_tree_node_set_XXXX|YYYY is not defined in any .exported_symbols*

Zdenek

Signature · 3 lines
lvm-devel mailing list 
lvm-devel at redhat.com 
https://www.redhat.com/mailman/listinfo/lvm-devel 
#5 lore raw

PATCH 1/1 makefile: fail to compile if there are more than one exported symbols.

Dne 15.6.2015 v 11:26 Lidong Zhong napsal(a):

Quoted 12 lines

Hi ,

Without this patch, I would get the following error:

set -e;\
R=dm_lv_simple_resume dm_lv_simple_suspend dm_replace_mirror_table;\
test -z "$R" || { echo "Mismatch between symbols in shared library and lists in .exported_symbols.* files: $R"; false; } ;\

(for i in ./.exported_symbols.Base ./.exported_symbols.DM_1_02_97 ; do\
	echo "${i##*.} {"; echo "	global:";\
	/usr/bin/sed "s/^/		/;s/$/;/" < $i;\
	test "$i" = Base && { echo "	local:"; echo "		*;"; };\
	echo "};";\
Quoted 7 lines

done ) > .export.sym
/bin/sh: line 1: dm_lv_simple_suspend: command not found ../make.tmpl:508: recipe for target '.export.sym' failed make[1]: *** [.export.sym] Error 127
make[1]: Leaving directory '/home/lwang/LVM2.2.02.120/libdm' make.tmpl:323: recipe for target 'libdm.device-mapper' failed
make: *** [libdm.device-mapper] Error 2

Hmmm interesting - in my case I get:

---
set -e;\
R=$(sort .exported_symbols_generated .exported_symbols.Base .exported_symbols.DM_1_02_98 .exported_symbols.DM_1_02_97 | uniq -u);\
test -z "$R" || { echo "Mismatch between symbols in shared library and lists in .exported_symbols.* files: $R"; false; } ;\
---

While you get directly assigned result.

So how is possible that in your case you get already 'translated' string, while in my case I get regular shell evaluation R=$(sort....) which should not need "".

Are you testing against latest 'git' HEAD ?

Do you this in make.tmpl.in?

.export.sym: .exported_symbols_generated $(EXPORTED_SYMBOLS) ifeq (,$(firstword $(EXPORTED_SYMBOLS)))

	set -e; (echo "Base {"; echo "	global:";\
		 $(SED) "s/^/		/;s/$$/;/" $<;\
		 echo "	local:"; echo "		*;"; echo "};") > $@
else
	set -e;\
	R=$$(sort $^ | uniq -u);\
	test -z "$$R" || { echo "Mismatch between symbols in shared library and lists 
in .exported_symbols.* files: $$R"; false; } ;\
	for i in $(EXPORTED_SYMBOLS); do\
		echo "$${i##*.} {"; echo "	global:";\
		$(SED) "s/^/		/;s/$$/;/" $$i;\
		test "$$i" = Base && { echo "	local:"; echo "		*;"; };\
		echo "};";\
	done > $@

endif

Zdenek

#6 lore raw

PATCH 1/1 makefile: fail to compile if there are more than one exported symbols.

Hi Zdenek,

Sorry I forgot to check the latest source, and this has been fixed in your latest commit of make.tmpl.in. Sorry for the noise :(

Regards,
Lidong

Quoted 1 line
Quoted 1 line
Quoted 1 line

On 6/15/2015 at 05:43 PM, in message <[email protected]>, Zdenek

Quoted 71 lines · Kabelac

Dne 15.6.2015 v 11:26 Lidong Zhong napsal(a):

Quoted 7 lines

Hi ,

Without this patch, I would get the following error:

set -e;\
R=dm_lv_simple_resume dm_lv_simple_suspend dm_replace_mirror_table;\
test -z "$R" || { echo "Mismatch between symbols in shared library and lists

in .exported_symbols.* files: $R"; false; } ;\

Quoted 5 lines
(for i in ./.exported_symbols.Base ./.exported_symbols.DM_1_02_97 ; do\ 
	echo "${i##*.} {"; echo "	global:";\ 
	/usr/bin/sed "s/^/		/;s/$/;/" < $i;\ 
	test "$i" = Base && { echo "	local:"; echo "		*;"; };\ 
	echo "};";\ 
Quoted 7 lines

done ) > .export.sym
/bin/sh: line 1: dm_lv_simple_suspend: command not found ../make.tmpl:508: recipe for target '.export.sym' failed make[1]: *** [.export.sym] Error 127
make[1]: Leaving directory '/home/lwang/LVM2.2.02.120/libdm' make.tmpl:323: recipe for target 'libdm.device-mapper' failed
make: *** [libdm.device-mapper] Error 2

Hmmm interesting - in my case I get:

---
set -e;\
R=$(sort .exported_symbols_generated .exported_symbols.Base .exported_symbols.DM_1_02_98 .exported_symbols.DM_1_02_97 | uniq -u);\
test -z "$R" || { echo "Mismatch between symbols in shared library and lists in .exported_symbols.* files: $R"; false; } ;\
---

While you get directly assigned result.

So how is possible that in your case you get already 'translated' string, while in my case I get regular shell evaluation R=$(sort....) which should

not need "".

Are you testing against latest 'git' HEAD ?

Do you this in make.tmpl.in?

.export.sym: .exported_symbols_generated $(EXPORTED_SYMBOLS) ifeq (,$(firstword $(EXPORTED_SYMBOLS)))

	set -e; (echo "Base {"; echo "	global:";\ 
		 $(SED) "s/^/		/;s/$$/;/" $<;\ 
		 echo "	local:"; echo "		*;"; echo "};") > $@ 
else 
	set -e;\ 
	R=$$(sort $^ | uniq -u);\ 
	test -z "$$R" || { echo "Mismatch between symbols in shared library and lists  
in .exported_symbols.* files: $$R"; false; } ;\ 
	for i in $(EXPORTED_SYMBOLS); do\ 
		echo "$${i##*.} {"; echo "	global:";\ 
		$(SED) "s/^/		/;s/$$/;/" $$i;\ 
		test "$$i" = Base && { echo "	local:"; echo "		*;"; };\ 
		echo "};";\ 
	done > $@ 

endif

Zdenek

Signature · 3 lines
lvm-devel mailing list 
lvm-devel at redhat.com 
https://www.redhat.com/mailman/listinfo/lvm-devel