From: John Spencer <maillist-lvm@barfooze.de>
To: linux-lvm@redhat.com
Subject: [linux-lvm] lvm2 portability issues (GNU sed is assumed)
Date: Tue, 29 Jan 2013 20:51:21 +0100 [thread overview]
Message-ID: <51082839.5080400@barfooze.de> (raw)
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
next reply other threads:[~2013-01-29 19:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-29 19:51 John Spencer [this message]
2013-01-30 2:55 ` [linux-lvm] lvm2 portability issues (GNU sed is assumed) Alasdair G Kergon
2013-01-31 3:31 ` John Spencer
2013-02-24 15:12 ` John Spencer
2013-03-19 17:38 ` John Spencer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51082839.5080400@barfooze.de \
--to=maillist-lvm@barfooze.de \
--cc=linux-lvm@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.