[tlbuild] yet another progress report from Utah: OpenBSD (mostly a success)

Nelson H. F. Beebe beebe at math.utah.edu
Fri May 4 18:48:33 CEST 2012


Using the texlive-20120503 snapshot, with disabling of libicu, and
with a small patch, I have finally been able to get TeX Live 2012 to
build on OpenBSD 4.9 i386, producing an installed binary directory
i386-openbsd containing 347 executables.  The only ones missing
compared to the i386-linux directory are these:

	biber           bibtexu         teckit_compile  xelatex         xetex

There has not been OpenBSD support in TeX Live since 2008; now we can
restore most of that support.

The

	http://www.math.utah.edu/~beebe/tlbuild/build-texlive-2012.sh

script contains my current build procedures for all platforms. For
OpenBSD, it currently sets

	CPPFLAGS="-DU_PLATFORM=U_PF_BSD"
	TL_CONFIGURE_FLAGS="--without-iconv --without-graphite --disable-xetex --disable-bibtexu"

The fix that I had to make was in response to this failure:

	libtool: install: strip --strip-debug /local/build/bare/texlive-20120501/source/inst/lib/i386-unknown-openbsd4.9/libkpathsea.a
	strip: /local/build/bare/texlive-20120501/source/inst/lib/i386-unknown-openbsd4.9/sts0DuTN/libfontconfig.a: Invalid operation

What is happening is that the OpenBSD strip command chokes on a
library archive file that itself contains archive files.

Here is a demo:

	## get a private modifiable copy of the kpathsea library
	% cp /local/build/bare/texlive-20120503/source/inst/lib/i386-unknown-openbsd4.9/libkpathsea.a .

	## verify that we are using the OpenBSD, rather than GNU, strip command
	% which strip
	/usr/bin/strip

	## show the library contents
	% ar tv libkpathsea.a
	rw-r--r-- 887/810 704196 Apr 19 10:40 2012 libfontconfig.a
	r--r--r-- 0/7 391914 Mar  2 06:52 2011 libexpat.a
	rw-r--r-- 887/810 705360 Mar  8 18:37 2012 libfreetype.a
	rw-rw-r-- 887/810  68558 Dec 15 13:55 2011 libbz2.a
	...
	rw-rw-r-- 887/810   6824 May  3 15:52 2012 libkpathsea_la-xstat.o
	rw-rw-r-- 887/810   2436 May  3 15:52 2012 libkpathsea_la-xstrdup.o

	# try to strip the library
	% strip libkpathsea.a
	strip: stPseABt/libfontconfig.a: Invalid operation

If I make a copy of the library, delete the *.a entries, and then
retry with strip, it succeeds:

	## copy under new name
	% cp libkpathsea.a libfoo.a

	## delete *.a library members
	% ar d libfoo.a libfontconfig.a libexpat.a libfreetype.a libbz2.a libz.a

	## show the library contents
	% ar tv libfoo.a | head -n10
	rw-rw-r-- 887/810  54108 May  3 15:51 2012 libkpathsea_la-tex-file.o
	rw-rw-r-- 887/810   5968 May  3 15:51 2012 libkpathsea_la-absolute.o
	rw-rw-r-- 887/810   5692 May  3 15:51 2012 libkpathsea_la-atou.o
	rw-rw-r-- 887/810  11184 May  3 15:51 2012 libkpathsea_la-cnf.o
	rw-rw-r-- 887/810   2564 May  3 15:51 2012 libkpathsea_la-concat.o
	rw-rw-r-- 887/810   2688 May  3 15:51 2012 libkpathsea_la-concat3.o
	rw-rw-r-- 887/810   2680 May  3 15:51 2012 libkpathsea_la-concatn.o
	rw-rw-r-- 887/810  18772 May  3 15:51 2012 libkpathsea_la-db.o
	rw-rw-r-- 887/810   6256 May  3 15:51 2012 libkpathsea_la-debug.o
	rw-rw-r-- 887/810   7744 May  3 15:51 2012 libkpathsea_la-dir.o

	## strip symbols
	% strip libfoo.a
	[no errors]

	## show how much stripping helped to reduce the size (a 23.1 times reduction)
	% ls -l libkpathsea.a libfoo.a
	-rwxr-xr-x 1 beebe sysstaff  103622 May  3 17:45 libfoo.a
	-rwxr-xr-x 1 beebe sysstaff 2398204 May  3 16:57 libkpathsea.a

In 30+ years of using various Unix systems, I do not recall ever
encountering a library file that itself contained *.a files.  I read
the man page for ar and ld on both Solaris and GNU/Linux this morning,
and find no mention in any of them of that possibility.

Because the call to the OpenBSD strip command that chokes is itself
embedded in a nasty libtool script, and the automake-generated
Makefile is excessibly complex, it did not appear to be
straightforward to modify the Makefile to ignore an error from strip
(other than by putting a leading hyphen on the command), and it did
not seem to make sense to make the Makefile even more complex by
embedding a platform-specific test for OpenBSD.

Instead, I created a new directory, /tmp/bin, with this workaround
script

	% cat /tmp/bin/strip
	#! /bin/sh
	/usr/bin/strip "$@" || true

and then put /tmp/bin at the head of the PATH directory list.

QUESTION: Karl, or whoever else is maintaining kpathsea: why are *.a
files added to the libkpathsea.a file by commands in the Makefile?  Is
this just an oversight that never before caused problems on other TeX
Live build hosts, or is there some magical reason for doing so, and if
so, what is the explanation?

I'm now going to try the same trick with this morning's snapshot,
texlive-20120504, with the libicu compilations restored.

-------------------------------------------------------------------------------
- Nelson H. F. Beebe                    Tel: +1 801 581 5254                  -
- University of Utah                    FAX: +1 801 581 4148                  -
- Department of Mathematics, 110 LCB    Internet e-mail: beebe at math.utah.edu  -
- 155 S 1400 E RM 233                       beebe at acm.org  beebe at computer.org -
- Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe/ -
-------------------------------------------------------------------------------


More information about the tlbuild mailing list