[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: libgc5 port to Hurd



On Wed, Apr 19, 2000 at 09:28:43AM +0100, Chris Lingard wrote:
> diff -Naur libgc-5.0.alpha4/debian/rules new/debian/rules
> --- libgc-5.0.alpha4/debian/rules	Tue Apr 18 18:34:15 2000
> +++ new/debian/rules	Mon Apr 17 19:37:51 2000
> @@ -16,6 +16,14 @@
>  # disable all threading
>  THREADS :=
>  
> +# Map pthreads to null for Hurd
> +opsys := $(shell uname)
> +@ if [ $(opsys) = "GNU" ];  then  \
> +      PTHREADS = \
> +    else   \
> +      PTHREADS = -lpthread  \
> +fi
> +
>  build: build-stamp
>  build-stamp:
>  	dh_testdir

This is much better done with:

DEB_HOST_GNU_SYSTEM=$(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM)
ifeq ($(DEB_HOST_GNU_SYSTEM), "gnu")
  PTHREADS = 
else
  PTHREADS = -lpthread
fi

> @@ -32,11 +40,11 @@
>  	# First build the shared library
>  	cd shared ; \
>  	  $(MAKE) -f ../Makefile CC="gcc" CXX="g++" VPATH=".." srcdir=".." \
> -	      DEBIAN_CFLAGS="-O2 -pipe ${THREADS} -D_REENTRANT" \
> -	      DEBIAN_PIC="-fPIC -DPIC" \
> +	      DEBIAN_CFLAGS="-O2 -g  -pipe ${THREADS} -D_REENTRANT -fPIC -DPIC" \
> +	      DEBIAN_PIC="" \
>  	      gc.a cords c++ && \
> -	    gcc -fPIC -shared -Wl,-soname,$(package).so.$(version_major) \
> -	      -o $(package).so.$(version) `ls *.o cord/*.o` -lc -lpthread
> +	    gcc -shared -g -Wl,-soname,$(package).so.$(version_major) \
> +	      -o $(package).so.$(version) `ls *.o cord/*.o` -lc $(PTHREADS)
>  	#
>  	# Build the static library (it does not need Position Independent Code,
>  	# which reserves one register; thus without -fPIC we get more efficient

Chris, can you comment why you stripped the -fPIC option from the gcc
command line, and why you moved the PIC options from DEBIAN_PIC to
DEBIAN_CFLAGS?

> @@ -44,7 +52,7 @@
>  	#
>  	cd static ; \
>  	     $(MAKE) -f ../Makefile CC="gcc" CXX="g++" VPATH=".." srcdir=".." \
> -	          DEBIAN_CFLAGS="-O2 -pipe ${THREADS} -D_REENTRANT" \
> +	          DEBIAN_CFLAGS="-O2 -g -pipe ${THREADS} -D_REENTRANT" \
>  		  DEBIAN_PIC="" \
>  		  LDFLAGS="-s" \
>  		  gc.a cords c++

This looks like it is just cruft from your testing. Can you verify that?

> @@ -128,7 +136,7 @@
>  #	dh_undocumented
>  
>  	dh_link
> -	dh_strip
> +#	dh_strip
>  	dh_compress
>  	dh_fixperms
>  	dh_suidregister

Same here?

> --- libgc-5.0.alpha4/gcconfig.h	Tue Apr 18 18:34:15 2000
> +++ new/gcconfig.h	Mon Apr 17 18:13:33 2000
> @@ -289,7 +289,14 @@
>  #   endif
>  #   define mach_type_known
>  # endif
> -
> +# if defined(__GNU__)
> +#   if defined(__i386__)
> +/* The Debian Hurd running on generic PC */  

/* The GNU/Hurd running on generic PC */

(really nothing Debian specific about it :)

> @@ -493,15 +498,15 @@
>          longjmp(GC_jmp_buf, 1);
>      }
>  
> -#   ifdef __STDC__
> +#   if defined(__STDC__) || defined(HURD)
>  	typedef void (*handler)(int);
>  #   else
>  	typedef void (*handler)();
>  #   endif

I think we can agree that __STDC__ must be defined on the Hurd.

Thanks,
Marcus

-- 
`Rhubarb is no Egyptian god.' Debian http://www.debian.org Check Key server 
Marcus Brinkmann              GNU    http://www.gnu.org    for public PGP Key 
Marcus.Brinkmann@ruhr-uni-bochum.de,     marcus@gnu.org    PGP Key ID 36E7CD09
http://homepage.ruhr-uni-bochum.de/Marcus.Brinkmann/       brinkmd@debian.org



Reply to: