pseudo: Uprev to the latest git version

Uprev pseudo to the latest head version to resolve a number of issues
on older hosts such as RHEL 5.  In addition sqlite was changed to link
statically into pseudo to avoid a potential LD_LIBRARY_PATH issue.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
This commit is contained in:
Mark Hatle 2010-07-21 06:15:53 -07:00 committed by Richard Purdie
parent 971907567c
commit ad0ac0ecd3
7 changed files with 149 additions and 113 deletions

View File

@ -108,8 +108,8 @@ SRCREV_pn-osc-native ??= "9096"
SRCREV_pn-owl-video ??= "394" SRCREV_pn-owl-video ??= "394"
SRCREV_pn-pkgconfig ??= "66d49f1375fec838bcd301bb4ca2ef76cee0e47c" SRCREV_pn-pkgconfig ??= "66d49f1375fec838bcd301bb4ca2ef76cee0e47c"
SRCREV_pn-psplash ??= "424" SRCREV_pn-psplash ??= "424"
SRCREV_pn-pseudo ??= "086e65c90420b3d38f30c3cd81a0f8573f6f69cf" SRCREV_pn-pseudo ??= "973e40da8e5abb080cc0b9c9eaff4d84dea5b42c"
SRCREV_pn-pseudo-native ??= "086e65c90420b3d38f30c3cd81a0f8573f6f69cf" SRCREV_pn-pseudo-native ??= "973e40da8e5abb080cc0b9c9eaff4d84dea5b42c"
QEMUSRCREV ??= "72bb3c7571226af13cfe9eec020a56add3d30a70" QEMUSRCREV ??= "72bb3c7571226af13cfe9eec020a56add3d30a70"
SRCREV_pn-qemu-native ??= "${QEMUSRCREV}" SRCREV_pn-qemu-native ??= "${QEMUSRCREV}"
SRCREV_pn-qemu-nativesdk ??= "${QEMUSRCREV}" SRCREV_pn-qemu-nativesdk ??= "${QEMUSRCREV}"

View File

@ -7,62 +7,70 @@ dyanmic linker can figure out anything else with rpaths.
Inspired by RP's patch of a similar intent for fakeroot Inspired by RP's patch of a similar intent for fakeroot
JL 15/07/10 JL 15/07/10
(updated 20/7/2010 - MGH)
Index: git/pseudo_util.c --- git.orig/pseudo_util.c 2010-07-20 15:34:41.000000000 -0700
=================================================================== +++ git/pseudo_util.c 2010-07-20 16:00:35.000000000 -0700
--- git.orig/pseudo_util.c 2010-03-25 17:57:24.000000000 +0000 diff -ur git.orig/pseudo_util.c git/pseudo_util.c
+++ git/pseudo_util.c 2010-07-15 16:13:09.431459640 +0100 --- git.orig/pseudo_util.c 2010-07-20 17:02:13.000000000 -0700
@@ -362,40 +362,25 @@ +++ git/pseudo_util.c 2010-07-20 17:03:26.000000000 -0700
@@ -65,7 +65,7 @@
* the end of the string or a space after it.
*/ */
void static char *libpseudo_name = "libpseudo.so";
pseudo_setupenv(char *opts) { -static char *libpseudo_pattern = "(=| )libpseudo[^ ]*\\.so($| )";
- char *ld_env; +static char *libpseudo_pattern = "(=| )[^ ]*libpseudo[^ ]*\\.so($| )";
char *newenv; static regex_t libpseudo_regex;
size_t len; static int libpseudo_regex_compiled = 0;
char debugvalue[64];
- newenv = "libpseudo.so"; @@ -499,8 +499,10 @@
+ /* need to set LD_PRELOAD to the absolute library path, as tweaking found_opts = 1;
+ * LD_LIBRARY_PATH makes the Beaver sad. if (!memcmp(environ[i], "PSEUDO_DEBUG=", 13))
+ * Fortunately we can hack this as we know we don't use lib64 :-) found_debug = 1;
+ */ +#if 0
+ if (!memcmp(environ[i], "LD_LIBRARY_PATH=", 16))
+ char *libname = "libpseudo.so"; found_libpath = 1;
+ char *prefix = pseudo_prefix_path("lib"); +#endif
+ len = strlen(prefix) + strlen(libname) + 2; ++env_count;
+ newenv = malloc(len); }
+ env_count += 4 - (found_preload + found_libpath + found_debug + found_opts);
+ snprintf(newenv, len, "%s/%s", prefix, libname); @@ -520,6 +522,7 @@
+ return NULL;
setenv("LD_PRELOAD", newenv, 1); }
new_environ[j++] = newenv;
- ld_env = getenv("LD_LIBRARY_PATH"); +#if 0
- if (ld_env) { } else if (!memcmp(environ[i], "LD_LIBRARY_PATH=", 16)) {
- char *prefix = pseudo_prefix_path(NULL); if (!strstr(environ[i], PSEUDO_PREFIX)) {
- if (!strstr(ld_env, prefix)) { char *e1, *e2;
- char *e1, *e2; @@ -537,10 +540,12 @@
- e1 = pseudo_prefix_path("lib"); } else {
- e2 = pseudo_prefix_path("lib64"); new_environ[j++] = environ[i];
- len = strlen(ld_env) + strlen(e1) + strlen(e2) + 3; }
- newenv = malloc(len); +#endif
- snprintf(newenv, len, "%s:%s:%s", ld_env, e1, e2); } else {
- free(e1); new_environ[j++] = environ[i];
- free(e2); }
- setenv("LD_LIBRARY_PATH", newenv, 1); }
- free(newenv); +#if 0
- } if (!found_libpath) {
- free(prefix); char *e1, *e2;
- } else { e1 = pseudo_prefix_path("lib");
- char *e1, *e2; @@ -553,8 +558,18 @@
- e1 = pseudo_prefix_path("lib"); snprintf(newenv, len, "LD_LIBRARY_PATH=%s:%s", e1, e2);
- e2 = pseudo_prefix_path("lib64"); new_environ[j++] = newenv;
- len = strlen(e1) + strlen(e2) + 2; }
- newenv = malloc(len); +#endif
- snprintf(newenv, len, "%s:%s", e1, e2); if (!found_preload) {
- setenv("LD_LIBRARY_PATH", newenv, 1); +#if 0
- free(newenv); new_environ[j++] = "LD_PRELOAD=libpseudo.so";
- } +#else
+ free(newenv); + char *libname = "libpseudo.so";
+ char *prefix = pseudo_prefix_path("lib");
if (max_debug_level) { + len = 11 + strlen(prefix) + strlen(libname) + 2;
sprintf(debugvalue, "%d", max_debug_level); + newenv = malloc(len);
+ snprintf(newenv, len, "LD_PRELOAD=%s/%s", prefix, libname);
+ new_environ[j++] = newenv;
+#endif
}
if (!found_debug && max_debug_level > 0) {
len = 16;

View File

@ -0,0 +1,14 @@
Add a missing dependency to fix a problem with building pseudo in a
parallel build.
--- git.orig/Makefile.in 2010-07-20 16:15:30.000000000 -0700
+++ git/Makefile.in 2010-07-20 16:15:58.000000000 -0700
@@ -105,7 +105,7 @@
.SECONDARY: wrappers
-pseudo_wrapfuncs.c: wrappers
+pseudo_wrapfuncs.c pseudo_wrapfuncs.h: wrappers
# no-strict-aliasing is needed for the function pointer trickery.
pseudo_wrappers.o: $(GUTS) pseudo_wrappers.c pseudo_wrapfuncs.c pseudo_wrapfuncs.h

View File

@ -3,11 +3,11 @@ $(localstatedir) so this quick hack makes pseudo use a data directory specified
with --data, and defaults to pseudo's way if it's not set. with --data, and defaults to pseudo's way if it's not set.
JL 14/07/10 JL 14/07/10
(updated 20/7/2010 - MGH)
Index: git/Makefile.in diff -urN git.orig/Makefile.in git/Makefile.in
=================================================================== --- git.orig/Makefile.in 2010-07-20 15:47:46.000000000 -0700
--- git.orig/Makefile.in 2010-07-14 16:50:45.772094105 +0100 +++ git/Makefile.in 2010-07-20 15:43:31.000000000 -0700
+++ git/Makefile.in 2010-07-14 16:50:45.897400059 +0100
@@ -20,6 +20,7 @@ @@ -20,6 +20,7 @@
# configuration flags # configuration flags
PREFIX=@PREFIX@ PREFIX=@PREFIX@
@ -26,17 +26,16 @@ Index: git/Makefile.in
+DATADIR=$(DATA)/pseudo +DATADIR=$(DATA)/pseudo
+endif +endif
CFLAGS_BASE=-pipe -std=gnu99 -Wall CFLAGS_BASE=-pipe -std=gnu99 -Wall -W -Wextra
CFLAGS_CODE=-fPIC -D_LARGEFILE64_SOURCE -D_ATFILE_SOURCE -m$(BITS) CFLAGS_CODE=-fPIC -D_LARGEFILE64_SOURCE -D_ATFILE_SOURCE -m$(BITS)
-CFLAGS_DEFS=-DPSEUDO_PREFIX='"$(PREFIX)"' -DPSEUDO_SUFFIX='"$(SUFFIX)"' -DPSEUDO_VERSION='"$(VERSION)"' -CFLAGS_DEFS=-DPSEUDO_PREFIX='"$(PREFIX)"' -DPSEUDO_SUFFIX='"$(SUFFIX)"' -DPSEUDO_VERSION='"$(VERSION)"'
+CFLAGS_DEFS=-DPSEUDO_PREFIX='"$(PREFIX)"' -DPSEUDO_SUFFIX='"$(SUFFIX)"' -DPSEUDO_VERSION='"$(VERSION)"' -DPSEUDO_DATA='"$(DATADIR)"' +CFLAGS_DEFS=-DPSEUDO_PREFIX='"$(PREFIX)"' -DPSEUDO_SUFFIX='"$(SUFFIX)"' -DPSEUDO_VERSION='"$(VERSION)"' -DPSEUDO_DATA='"$(DATADIR)"'
CFLAGS_DEBUG=-O2 -g CFLAGS_DEBUG=-O2 -g
CFLAGS_SQL=-L$(SQLITE)/lib -I$(SQLITE)/include CFLAGS_SQL=-L$(SQLITE)/lib -I$(SQLITE)/include
EXTRA_CFLAGS=$(CFLAGS_BASE) $(CFLAGS_CODE) $(CFLAGS_DEFS) \ EXTRA_CFLAGS=$(CFLAGS_BASE) $(CFLAGS_CODE) $(CFLAGS_DEFS) \
Index: git/configure diff -urN git.orig/configure git/configure
=================================================================== --- git.orig/configure 2010-07-20 15:34:41.000000000 -0700
--- git.orig/configure 2010-03-25 17:57:24.000000000 +0000 +++ git/configure 2010-07-20 15:42:23.000000000 -0700
+++ git/configure 2010-07-14 16:50:45.897400059 +0100
@@ -20,13 +20,14 @@ @@ -20,13 +20,14 @@
# not a real configure script... # not a real configure script...
opt_prefix= opt_prefix=
@ -71,11 +70,10 @@ Index: git/configure
s,@SQLITE@,'"$opt_sqlite"',g s,@SQLITE@,'"$opt_sqlite"',g
s,@MARK64@,'"$opt_mark64"',g s,@MARK64@,'"$opt_mark64"',g
s,@BITS@,'"$opt_bits"',g s,@BITS@,'"$opt_bits"',g
Index: git/pseudo.c diff -urN git.orig/pseudo.c git/pseudo.c
=================================================================== --- git.orig/pseudo.c 2010-07-20 15:34:41.000000000 -0700
--- git.orig/pseudo.c 2010-03-25 17:57:24.000000000 +0000 +++ git/pseudo.c 2010-07-20 15:42:23.000000000 -0700
+++ git/pseudo.c 2010-07-14 16:50:45.898400595 +0100 @@ -272,7 +272,7 @@
@@ -191,7 +191,7 @@
pseudo_new_pid(); pseudo_new_pid();
pseudo_debug(3, "opening lock.\n"); pseudo_debug(3, "opening lock.\n");
@ -83,12 +81,11 @@ Index: git/pseudo.c
+ lockname = strdup(PSEUDO_LOCKFILE); + lockname = strdup(PSEUDO_LOCKFILE);
if (!lockname) { if (!lockname) {
pseudo_diag("Couldn't allocate a file path.\n"); pseudo_diag("Couldn't allocate a file path.\n");
exit(1); exit(EXIT_FAILURE);
Index: git/pseudo.h diff -urN git.orig/pseudo.h git/pseudo.h
=================================================================== --- git.orig/pseudo.h 2010-07-20 15:34:41.000000000 -0700
--- git.orig/pseudo.h 2010-03-25 17:57:24.000000000 +0000 +++ git/pseudo.h 2010-07-20 15:44:31.000000000 -0700
+++ git/pseudo.h 2010-07-14 16:50:45.899360463 +0100 @@ -134,11 +134,10 @@
@@ -121,8 +121,7 @@
extern char *pseudo_version; extern char *pseudo_version;
@ -101,11 +98,13 @@ Index: git/pseudo.h
+#define PSEUDO_LOGFILE PSEUDO_DATA "/pseudo.log" +#define PSEUDO_LOGFILE PSEUDO_DATA "/pseudo.log"
+#define PSEUDO_PIDFILE PSEUDO_DATA "/pseudo.pid" +#define PSEUDO_PIDFILE PSEUDO_DATA "/pseudo.pid"
+#define PSEUDO_SOCKET PSEUDO_DATA "/pseudo.socket" +#define PSEUDO_SOCKET PSEUDO_DATA "/pseudo.socket"
Index: git/pseudo_db.c
=================================================================== /* some systems might not have *at(). We like to define operations in
--- git.orig/pseudo_db.c 2010-03-25 17:57:24.000000000 +0000 * terms of each other, and for instance, open(...) is the same as
+++ git/pseudo_db.c 2010-07-14 16:51:07.506464213 +0100 diff -urN git.orig/pseudo_db.c git/pseudo_db.c
@@ -458,11 +458,11 @@ --- git.orig/pseudo_db.c 2010-07-20 15:34:41.000000000 -0700
+++ git/pseudo_db.c 2010-07-20 15:42:23.000000000 -0700
@@ -471,11 +471,11 @@
if (*db) if (*db)
return 0; return 0;
if (db == &file_db) { if (db == &file_db) {
@ -119,11 +118,10 @@ Index: git/pseudo_db.c
rc = sqlite3_open(dbfile, db); rc = sqlite3_open(dbfile, db);
free(dbfile); free(dbfile);
} }
Index: git/pseudo_server.c diff -urN git.orig/pseudo_server.c git/pseudo_server.c
=================================================================== --- git.orig/pseudo_server.c 2010-07-20 15:34:41.000000000 -0700
--- git.orig/pseudo_server.c 2010-03-25 17:57:24.000000000 +0000 +++ git/pseudo_server.c 2010-07-20 15:46:09.000000000 -0700
+++ git/pseudo_server.c 2010-07-14 16:50:45.901462874 +0100 @@ -107,9 +107,9 @@
@@ -101,9 +101,9 @@
} }
/* cd to the data directory */ /* cd to the data directory */
@ -135,7 +133,7 @@ Index: git/pseudo_server.c
return 1; return 1;
} }
if (chdir(pseudo_path) == -1) { if (chdir(pseudo_path) == -1) {
@@ -132,9 +132,9 @@ @@ -138,9 +138,9 @@
return 0; return 0;
} }
setsid(); setsid();
@ -147,15 +145,15 @@ Index: git/pseudo_server.c
return 1; return 1;
} }
fp = fopen(pseudo_path, "w"); fp = fopen(pseudo_path, "w");
@@ -152,9 +152,9 @@ diff -ur git.orig/pseudo_util.c git/pseudo_util.c
pseudo_new_pid(); --- git.orig/pseudo_util.c 2010-07-20 17:06:22.000000000 -0700
fclose(stdin); +++ git/pseudo_util.c 2010-07-20 17:10:50.000000000 -0700
fclose(stdout); @@ -855,7 +855,7 @@
- pseudo_path = pseudo_prefix_path(PSEUDO_LOGFILE); pseudo_debug(3, "no special log file requested, using stderr.\n");
+ pseudo_path = strdup(PSEUDO_LOGFILE); return -1;
if (!pseudo_path) {
- pseudo_diag("can't get path for prefix/%s\n", PSEUDO_LOGFILE);
+ pseudo_diag("can't get path for %s\n", PSEUDO_LOGFILE);
return 1;
} }
fd = open(pseudo_path, O_WRONLY | O_APPEND | O_CREAT, 0644); - pseudo_path = pseudo_prefix_path(defname);
+ pseudo_path = strdup(defname);
if (!pseudo_path) {
pseudo_diag("can't get path for prefix/%s\n", PSEUDO_LOGFILE);
return -1;

View File

@ -0,0 +1,15 @@
Due to disabling the LD_LIBRARY_PATH handling, we need to use a static
libsqlite.
diff -ur git.orig/Makefile.in git/Makefile.in
--- git.orig/Makefile.in 2010-07-20 17:13:56.000000000 -0700
+++ git/Makefile.in 2010-07-20 17:12:14.000000000 -0700
@@ -45,7 +45,7 @@
GLOB_PATTERN=guts/*.c
GUTS=$(filter-out "$(GLOB_PATTERN)",$(wildcard $(GLOB_PATTERN)))
-DBLDFLAGS=-lsqlite3
+DBLDFLAGS=$(SQLITE)/lib/libsqlite3.a
USE_64=wrapfuncs64.in
SHOBJS=pseudo_table.o pseudo_util.o

View File

@ -6,14 +6,13 @@ until "make install" time when DESTDIR is set. Change the first target
to "all" for this reason. to "all" for this reason.
RP 18/3/10 RP 18/3/10
(updated 20/7/2010 - MGH)
Index: git/Makefile.in --- git.orig/Makefile.in 2010-07-20 15:34:41.000000000 -0700
=================================================================== +++ git/Makefile.in 2010-07-20 15:40:42.000000000 -0700
--- git.orig/Makefile.in 2010-03-17 16:05:17.000000000 +0000
+++ git/Makefile.in 2010-04-06 15:25:39.000000000 +0100
@@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
MARK64=@MARK64@ MARK64=@MARK64@
VERSION=0.2 VERSION=0.3
-LIBDIR=$(PREFIX)/lib$(MARK64) -LIBDIR=$(PREFIX)/lib$(MARK64)
+LIBDIR=$(PREFIX)/lib +LIBDIR=$(PREFIX)/lib
@ -46,15 +45,15 @@ Index: git/Makefile.in
@@ -66,26 +66,29 @@ @@ -66,26 +66,29 @@
install: all install-lib install-bin install-data install: all install-lib install-bin install-data
pseudo: pseudo.o $(SHOBJS) $(DBOBJS) pseudo_server.o pseudo_ipc.o pseudo: pseudo.o $(SHOBJS) $(DBOBJS) pseudo_client.o pseudo_server.o pseudo_ipc.o
- $(CC) $(CFLAGS) -o pseudo \ - $(CC) $(CFLAGS) -o pseudo \
+ $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -o pseudo \ + $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -o pseudo \
pseudo.o pseudo_server.o pseudo_client.o pseudo_ipc.o \ pseudo.o pseudo_server.o pseudo_client.o pseudo_ipc.o \
$(DBOBJS) $(SHOBJS) $(DBLDFLAGS) $(DBOBJS) $(SHOBJS) $(DBLDFLAGS)
pseudolog: pseudolog.o $(SHOBJS) $(DBOBJS) pseudolog: pseudolog.o $(SHOBJS) $(DBOBJS) pseudo_client.o pseudo_ipc.o
- $(CC) $(CFLAGS) -o pseudolog pseudolog.o \ - $(CC) $(CFLAGS) -o pseudolog pseudolog.o pseudo_client.o pseudo_ipc.o \
+ $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -o pseudolog pseudolog.o \ + $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -o pseudolog pseudolog.o pseudo_client.o pseudo_ipc.o \
$(DBOBJS) $(SHOBJS) $(DBLDFLAGS) $(DBOBJS) $(SHOBJS) $(DBLDFLAGS)
pseudodb: pseudodb.o $(SHOBJS) $(DBOBJS) pseudo_ipc.o pseudodb: pseudodb.o $(SHOBJS) $(DBOBJS) pseudo_ipc.o
@ -77,10 +76,10 @@ Index: git/Makefile.in
pseudo_client.o pseudo_server.o pseudo_ipc.o: pseudo_ipc.h pseudo_client.o pseudo_server.o pseudo_ipc.o: pseudo_ipc.h
pseudo_client.o: pseudo_client.h pseudo_client.o: pseudo_client.h
@@ -103,7 +106,7 @@ @@ -101,7 +104,7 @@
# no-strict-aliasing is needed for the function pointer trickery. # no-strict-aliasing is needed for the function pointer trickery.
pseudo_wrappers.o: pseudo_wrappers.c pseudo_wrappers.o: $(GUTS) pseudo_wrappers.c pseudo_wrapfuncs.c pseudo_wrapfuncs.h
- $(CC) -fno-strict-aliasing $(CFLAGS) -D_GNU_SOURCE -c -o pseudo_wrappers.o pseudo_wrappers.c - $(CC) -fno-strict-aliasing $(CFLAGS) -D_GNU_SOURCE -c -o pseudo_wrappers.o pseudo_wrappers.c
+ $(CC) -fno-strict-aliasing $(CFLAGS) $(EXTRA_CFLAGS) -D_GNU_SOURCE -c -o pseudo_wrappers.o pseudo_wrappers.c + $(CC) -fno-strict-aliasing $(CFLAGS) $(EXTRA_CFLAGS) -D_GNU_SOURCE -c -o pseudo_wrappers.o pseudo_wrappers.c

View File

@ -6,12 +6,14 @@ LICENSE = "LGPL2.1"
DEPENDS = "sqlite3" DEPENDS = "sqlite3"
PV = "0.0+git${SRCPV}" PV = "0.0+git${SRCPV}"
PR = "r4" PR = "r5"
SRC_URI = "git://github.com/wrpseudo/pseudo.git;protocol=git \ SRC_URI = "git://github.com/wrpseudo/pseudo.git;protocol=git \
file://tweakflags.patch \ file://tweakflags.patch \
file://path-munge.patch \ file://path-munge.patch \
file://ld_sacredness.patch" file://ld_sacredness.patch \
file://make_parallel.patch \
file://static_sqlite.patch"
FILES_${PN} = "${libdir}/libpseudo.so ${bindir}/* ${localstatedir}/pseudo" FILES_${PN} = "${libdir}/libpseudo.so ${bindir}/* ${localstatedir}/pseudo"
PROVIDES += "virtual/fakeroot" PROVIDES += "virtual/fakeroot"