linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] lvm2 portability issues (GNU sed is assumed)
@ 2013-01-29 19:51 John Spencer
  2013-01-30  2:55 ` Alasdair G Kergon
  0 siblings, 1 reply; 5+ messages in thread
From: John Spencer @ 2013-01-29 19:51 UTC (permalink / raw)
  To: linux-lvm

hi list,

during lvm2.2.02.98 compilation,
a linker script gets generated which exposes only symbols matching the 
gnu sed regex. this fails using a posix compliant sed program, leading 
to an almost empty linker script and subsequently missing symbols:

set -e; \
( cat ./.exported_symbols; \
   if test x./libdevmapper.h != x; then \
         gcc -E -P -I./ioctl -I. -I. -I../include -DHAVE_CONFIG_H 
-DDM_IOCTLS -DDM_DEVICE_UID=0 -DDM_DEVICE_GID=0 -DDM_DEVICE_MODE=0600 
./libdevmapper.h | \
         sed -ne "/^typedef|}/!s/.*[ \*]\(\dm_[a-z0-9_]*\)(.*/\1/p"; \
   fi \
) > .exported_symbols_generated
set -e; (echo "Base {"; echo "  global:"; \
          sed "s/^/              /;s/$/;/" < .exported_symbols_generated; \
          echo " local:"; echo "         *;"; echo "};") > .export.sym
gcc -shared -Wl,-soname,libdevmapper.so.1.02 \
         -D_GNU_SOURCE -fPIC  -O2 -Wl,--version-script,.export.sym 
-L../libdm -L../lib -L../libdaemon/client datastruct/bitset.o 
datastruct/hash.o datastruct/list.o libdm-common.o libdm-file.o 
libdm-deptree.o libdm-string.o libdm-report.o libdm-config.o 
mm/dbg_malloc.o mm/pool.o regex/matcher.o regex/parse_rx.o regex/ttree.o 
ioctl/libdm-iface.o    -o ioctl/libdevmapper.so.1.02


here is the statement that generates the symbollist:

gcc -E -P -I./ioctl -I. -I. -I../include -DHAVE_CONFIG_H -DDM_IOCTLS 
-DDM_DEVICE_UID=0 -DDM_DEVICE_GID=0 -DDM_DEVICE_MODE=0600 
./libdevmapper.h | sed -ne "/^typedef|}/!s/.*[ 
\*]\(\dm_[a-z0-9_]*\)(.*/\1/p";


may i ask kindly to reformulate that statement so that it works with 
posix sed (as used in busybox 1.20.2) ?

afaict, both the usage of | and \d are non-posix. the latter can 
probably be fixed by using [:digit:], the former by using 2 separate 
statements.

thanks,
--JS

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-03-19 17:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-29 19:51 [linux-lvm] lvm2 portability issues (GNU sed is assumed) John Spencer
2013-01-30  2:55 ` Alasdair G Kergon
2013-01-31  3:31   ` John Spencer
2013-02-24 15:12     ` John Spencer
2013-03-19 17:38       ` John Spencer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).