Bug#810579: nss: FTCBFS: defines LINUX based on uname

2016-01-09 Thread Steven Chamberlain
Package: nss
Version: 3.21-1
Severity: normal
Tags: patch
User: helm...@debian.org
Usertags: rebootstrap

Hi,

Helmut Grohne pointed out to me that nss fails to cross-build for
non-Linux host architectures, from a Linux build system:

| i586-kfreebsd-gnu-gcc -o OBJS/Linux_SINGLE_SHLIB/sysrand.o -c -g -O2 
-fstack-protector-strong -Wformat -Werror=format-security -Wall -pipe 
-Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Di386 -DLINUX2_1  -Wall -Werror -pipe 
-ffunction-sections -fdata-sections -DHAVE_STRERROR -DLINUX -Dlinux -DXP_UNIX 
-DSHLIB_SUFFIX=\"so\" -DSHLIB_PREFIX=\"lib\" -DSHLIB_VERSION=\"3\" 
-DSOFTOKEN_SHLIB_VERSION=\"3\" -DRIJNDAEL_INCLUDE_TABLES -UDEBUG -DNDEBUG 
-D_REENTRANT -DUSE_UTIL_DIRECTLY -DNO_NSPR_10_SUPPORT 
-DSSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES -DFREEBL_NO_DEPEND -DNSS_X86_OR_X64 
-DNSS_X86 -DMP_ASSEMBLY_MULTIPLY -DMP_ASSEMBLY_SQUARE  -DMP_ASSEMBLY_DIV_2DX1D 
-DMP_USE_UINT_DIGIT -DMP_CHAR_STORE_SLOW -DMP_IS_LITTLE_ENDIAN 
-DMP_API_COMPATIBLE -I/usr/include/nspr -I/tmp/buildd/nss/nss-3.21/dist/include 
-I/tmp/buildd/nss/nss-3.21/dist/public/nss 
-I/tmp/buildd/nss/nss-3.21/dist/private/nss -Impi -Iecl  sysrand.c
| In file included from sysrand.c:16:0:
| unix_rand.c:354:1: error: redefinition of 'GetHighResClock'
|  GetHighResClock(void *buf, size_t maxbytes)
|  ^
| In file included from sysrand.c:16:0:
| unix_rand.c:166:1: note: previous definition of 'GetHighResClock' was here
|  GetHighResClock(void *buf, size_t maxbytes)
|  ^
| In file included from sysrand.c:16:0:
https://jenkins.debian.net/job/rebootstrap_kfreebsd-i386_gcc5/43/console

This is the fault of debian/patches/38_kbsd.patch, which defines "LINUX"
based on the Makefile variable KERNEL, which in turn is derived from
`uname -s`.  This may be incorrect for cross-building situations:

-OS_CFLAGS  = $(STANDARDS_CFLAGS) $(DSO_CFLAGS) $(OS_REL_CFLAGS) 
$(ARCHFLAG) -Wall -Werror-implicit-function-declaration -Wno-switch -pipe 
-DLINUX -Dlinux -DHAVE_STRERROR
+OS_CFLAGS  = $(STANDARDS_CFLAGS) $(DSO_CFLAGS) $(OS_REL_CFLAGS) 
$(ARCHFLAG) -Wall -Werror-implicit-function-declaration -Wno-switch -pipe 
-DHAVE_STRERROR
+ifeq ($(KERNEL),linux)
+OS_CFLAGS  += -DLINUX -Dlinux
+endif

I suggest a cleaner solution that aliases macro "LINUX" to the preferred
modern one,  __linux__ which, along with "linux", are defined already by
the build system only when actually compiling for Linux:

-OS_CFLAGS  = $(STANDARDS_CFLAGS) $(DSO_CFLAGS) $(OS_REL_CFLAGS) 
$(ARCHFLAG) -Wall -Werror-implicit-function-declaration -Wno-switch -pipe 
-DLINUX -Dlinux -DHAVE_STRERROR
+OS_CFLAGS  = $(STANDARDS_CFLAGS) $(DSO_CFLAGS) $(OS_REL_CFLAGS) 
$(ARCHFLAG) -Wall -Werror-implicit-function-declaration -Wno-switch -pipe 
-DLINUX=__linux__ -DHAVE_STRERROR

Attached is a replacement debian/patches/38_kbsd.patch with this change.
I've tested it natively on kfreebsd-amd64 and linux-amd64.  It should be
correct for hurd also.

Thanks!

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: kfreebsd-amd64 (x86_64)

Kernel: kFreeBSD 10.1-0-amd64
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
## 38_kbsd.patch by Petr Salinger 
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: GNU/kFreeBSD support. bz#356011
## DP: Added Hurd support.

Index: nss/nss/lib/freebl/unix_rand.c
===
--- nss.orig/nss/lib/freebl/unix_rand.c
+++ nss/nss/lib/freebl/unix_rand.c
@@ -156,7 +156,8 @@ static SECStatus RNG_kstat(PRUint32* fed
 
 #if defined(SCO) || defined(UNIXWARE) || defined(BSDI) || defined(FREEBSD) \
 || defined(NETBSD) || defined(DARWIN) || defined(OPENBSD) \
-|| defined(NTO) || defined(__riscos__)
+|| defined(NTO) || defined(__riscos__) || defined(__GNU__) \
+|| defined(__FreeBSD_kernel__) || defined(__NetBSD_kernel__)
 #include 
 
 #define getdtablesize() sysconf(_SC_OPEN_MAX)
Index: nss/nss/lib/softoken/softoken.h
===
--- nss.orig/nss/lib/softoken/softoken.h
+++ nss/nss/lib/softoken/softoken.h
@@ -184,7 +184,7 @@ extern PRBool sftk_fatalError;
 
 #define CHECK_FORK_MIXED
 
-#elif defined(LINUX)
+#elif defined(LINUX) || defined (__GLIBC__)
 
 #define CHECK_FORK_PTHREAD
 
Index: nss/nss/lib/ssl/sslmutex.c
===
--- nss.orig/nss/lib/ssl/sslmutex.c
+++ nss/nss/lib/ssl/sslmutex.c
@@ -56,7 +56,7 @@ static SECStatus single_process_sslMutex
 return SECSuccess;
 }
 
-#if defined(LINUX) || defined(AIX) || defined(BEOS) || defined(BSDI) || (defined(NETBSD) && __NetBSD_Version__ < 5) || defined(OPENBSD)
+#if defined(LINUX) || defined(AIX) || defined(BEOS) || defined(BSDI) || (defined(NETBSD) && __NetBSD_Version__ < 5) || defined(OPENBSD) || defined(__GLI

Re: Fwd: Re: Bug#571136: please remove useless devices from devices.tar.gz

2016-01-09 Thread Marco d'Itri
On Jan 10, Cyril Brulebois  wrote:

> We have a bug report with a patch by Marco against debootstrap (see
> attachment), which changes how devices are generated; I can't really
> tell how much this might affect all of you (especially with debootstrap
It is not supposed to, since both hurd and kfreebsd already used 
a different method to manage /dev.

-- 
ciao,
Marco


signature.asc
Description: PGP signature


Fwd: Re: Bug#571136: please remove useless devices from devices.tar.gz

2016-01-09 Thread Cyril Brulebois
Hi ports people,

I'm not exactly sure what happened with debian-ports@ (I think there
were some planned changes but I don't remember the outcome), so I'm
explicitly sending this to bsd/hurd lists since I suspect the linux
ports are less likely to be affected by this.

We have a bug report with a patch by Marco against debootstrap (see
attachment), which changes how devices are generated; I can't really
tell how much this might affect all of you (especially with debootstrap
being arch:all, and not intended to only be used from a Debian system),
so I thought I'd send a heads-up first. You may want to look at other
mails (esp. from Marco) in the bug log for more background:
  https://bugs.debian.org/571136

Please keep the bug report and Marco in copy of your replies.

Mraw,
KiBi.
--- Begin Message ---
On Jan 08, Marco d'Itri  wrote:

> If there are some doubts that devices.tar.gz could still be needed in 
> the future then I would start with a smaller patch which keeps all the 
> old code around.
Here it is.
If somebody will report valid uses for devices.tar.gz then the old code 
can be enabled again easily.

-- 
ciao,
Marco
diff --git a/debian/changelog b/debian/changelog
index 8a938a3..59cf216 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+debootstrap (1.0.75+nmu1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Stop creating useless device nodes. (Closes: #571136)
+
+ -- Marco d'Itri   Sat, 09 Jan 2016 04:43:00 +0100
+
 debootstrap (1.0.75) unstable; urgency=medium
 
   * Stop cleaning KEEP_DEBOOTSTRAP_DIR twice, as spotted by Chris Lamb
diff --git a/functions b/functions
index 8bef5e6..cd7f1ef 100644
--- a/functions
+++ b/functions
@@ -1060,19 +1060,34 @@ setup_devices () {
 	hurd*)
 		setup_devices_hurd ;;
 	*)
-		if [ -e "$DEVICES_TARGZ" ]; then
+		if true; then
+			setup_devices_simple
+		elif [ -e "$DEVICES_TARGZ" ]; then
 			zcat "$DEVICES_TARGZ" | (cd "$TARGET"; tar -xf -)
 		else
-			if [ -e /dev/.devfsd ] ; then
-in_target mount -t devfs devfs /dev
-			else
-error 1 NODEVTGZ "no %s. cannot create devices" "$DEVICES_TARGZ"
-			fi
+			error 1 NODEVTGZ "no %s. cannot create devices" "$DEVICES_TARGZ"
 		fi
 		;;
 	esac
 }
 
+setup_devices_simple () {
+	# The list of devices that can be created in a container comes from
+	# src/core/cgroup.c in the systemd source tree.
+	mknod $TARGET/dev/null		c 1 3
+	mknod $TARGET/dev/zero		c 1 5
+	mknod $TARGET/dev/full		c 1 7
+	mknod $TARGET/dev/random	c 1 8
+	mknod $TARGET/dev/urandom	c 1 9
+	mknod $TARGET/dev/tty		c 5 0
+	mkdir $TARGET/dev/pts/ $TARGET/dev/shm/
+	ln -s pts/ptmx $TARGET/dev/ptmx
+	ln -s /proc/self/fd   $TARGET/dev/fd
+	ln -s /proc/self/fd/0 $TARGET/dev/stdin
+	ln -s /proc/self/fd/1 $TARGET/dev/stdout
+	ln -s /proc/self/fd/2 $TARGET/dev/stderr
+}
+
 setup_devices_hurd () {
 	# Use the setup-translators of the hurd package, and firmlink
 	# $TARGET/{dev,servers} to the system ones.


signature.asc
Description: PGP signature
--- End Message ---


signature.asc
Description: Digital signature


Re: d-i is BD-Uninstallable, package missing

2016-01-09 Thread Steven Chamberlain
Steven Chamberlain wrote:
> > | debian-installer build-depends on:
> > | - kfreebsd-amd64:librsvg2-bin
> > | kfreebsd-amd64:librsvg2-bin depends on:
> > | - kfreebsd-amd64:librsvg2-2 (>= 2.40.5-1)
> > | kfreebsd-amd64:librsvg2-2 depends on:
> > | - kfreebsd-amd64:libgdk-pixbuf2.0-0 (>= 2.22.0)
> > | kfreebsd-amd64:libgdk-pixbuf2.0-0 depends on missing:
> > | - kfreebsd-amd64:libgdk-pixbuf2.0-common (= 2.31.1-2+deb8u2)
> > https://buildd.debian.org/status/package.php?p=debian-installer&suite=jessie-kfreebsd

Actually, libgdk-pixbuf2.0-common (Arch:all) is entirely missing from
jessie-kfreebsd-p-u - not sure how that could have happened:

https://qa.debian.org/madison.php?package=libgdk-pixbuf2.0-common
 libgdk-pixbuf2.0-common | 2.31.1-2| jessie-kfreebsd  | all
 libgdk-pixbuf2.0-common | 2.31.1-2+deb8u2 | jessie   | all
 libgdk-pixbuf2.0-common | 2.31.1-2+deb8u4 | jessie-kfreebsd-security | all
 libgdk-pixbuf2.0-common | 2.31.1-2+deb8u4 | jessie-p-u   | all
 libgdk-pixbuf2.0-common | 2.31.1-2+deb8u4 | jessie-security  | all

jessie-kfreebsd-p-u is not listed at all.  We only have the arch-
dependent binary packages from src:gdk-pixbuf, for example:

https://qa.debian.org/madison.php?package=libgdk-pixbuf2.0-0
 libgdk-pixbuf2.0-0 | 2.31.1-2+deb8u2 | jessie-kfreebsd-p-u  | 
kfreebsd-amd64, kfreebsd-i386
 libgdk-pixbuf2.0-0 | 2.31.1-2+deb8u2 | jessie   | amd64, 
arm64, armel, armhf, i386, mips, mipsel, powerpc, ppc64el, s390x
 libgdk-pixbuf2.0-0 | 2.31.1-2+deb8u4 | jessie-kfreebsd-security | 
kfreebsd-amd64, kfreebsd-i386
 libgdk-pixbuf2.0-0 | 2.31.1-2+deb8u4 | jessie-p-u   | amd64, 
arm64, armel, armhf, i386, mips, mipsel, powerpc, ppc64el, s390x
 libgdk-pixbuf2.0-0 | 2.31.1-2+deb8u4 | jessie-security  | amd64, 
arm64, armel, armhf, i386, mips, mipsel, powerpc, ppc64el, s390x

Please could we get the missing packages copied from jessie to
jessie-kfreebsd-p-u:

 libgdk-pixbuf2.0-common | 2.31.1-2+deb8u2 | jessie   | all
 libgdk-pixbuf2.0-doc| 2.31.1-2+deb8u2 | jessie   | all

Thanks,
Regards,
-- 
Steven Chamberlain
ste...@pyro.eu.org


signature.asc
Description: Digital signature