Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Aug 2005 17:13:40 +0300
From:      Vasil Dimov <vd@datamax.bg>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        roam@FreeBSD.org
Subject:   ports/85120: Update port: devel/libelf to 0.8.6
Message-ID:  <20050819141340.GA4879@sinanica.bg.datamax>
Resent-Message-ID: <200508191420.j7JEK773006813@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         85120
>Category:       ports
>Synopsis:       Update port: devel/libelf to 0.8.6
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 19 14:20:07 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Vasil Dimov
>Release:        FreeBSD 5.4-STABLE i386
>Organization:
DataMax
>Environment:

>Description:

Update libelf from 0.8.5 to 0.8.6

* swap www.mr511.de and ${MASTER_SITE_SUNSITE} as the archive has not
  yet appeared on ${MASTER_SITE_SUNSITE} - save "Not found" cycles

* change nonexistent (in FreeBSD) types Elf64_Xword and Elf64_Sxword
  used in source with the equivalent ones: Elf64_Word and Elf64_Sword
  I have also attached a separate patch for each file, but the sed
  command in Makefile is easier for maintenance IMHO.

* introduce files/patch-Makefile.in to force libelf.pc to go in the
  right place

* sync files/patch-configure and pkg-plist

>How-To-Repeat:

>Fix:

--- libelf_0.8.5-0.8.6.diff begins here ---
diff -urN --exclude=CVS libelf.orig/Makefile libelf/Makefile
--- libelf.orig/Makefile	Mon May  9 12:52:34 2005
+++ libelf/Makefile	Fri Aug 19 16:38:23 2005
@@ -6,11 +6,10 @@
 #
 
 PORTNAME=	libelf
-PORTVERSION=	0.8.5
-PORTREVISION=	1
+PORTVERSION=	0.8.6
 CATEGORIES=	devel
-MASTER_SITES=	${MASTER_SITE_SUNSITE} \
-		http://www.mr511.de/software/
+MASTER_SITES=	http://www.mr511.de/software/ \
+		${MASTER_SITE_SUNSITE}
 MASTER_SITE_SUBDIR=	libs .
 
 MAINTAINER=	roam@FreeBSD.org
@@ -25,5 +24,15 @@
 USE_GETTEXT=	yes
 
 NOMAN=		defined
+
+USE_REINPLACE=	yes
+
+FILES_TO_PATCH=lib/32.fsize.c lib/64.xlatetof.c lib/cook.c lib/gelf.h lib/gelftrans.c
+
+post-patch:
+	@(cd ${WRKSRC} && ${REINPLACE_CMD} \
+	-e 's/Elf64_Xword/Elf64_Word/g' \
+	-e 's/Elf64_Sxword/Elf64_Sword/g' \
+	${FILES_TO_PATCH})
 
 .include <bsd.port.mk>
diff -urN --exclude=CVS libelf.orig/distinfo libelf/distinfo
--- libelf.orig/distinfo	Wed Mar 31 06:07:00 2004
+++ libelf/distinfo	Fri Aug 19 15:53:48 2005
@@ -1,2 +1,2 @@
-MD5 (libelf-0.8.5.tar.gz) = c1daf069367871350ece779b7de20047
-SIZE (libelf-0.8.5.tar.gz) = 132111
+MD5 (libelf-0.8.6.tar.gz) = d444fb0068cdfed01bb1fd1e91d29270
+SIZE (libelf-0.8.6.tar.gz) = 144198
diff -urN --exclude=CVS libelf.orig/files/patch-Makefile.in libelf/files/patch-Makefile.in
--- libelf.orig/files/patch-Makefile.in	Thu Jan  1 02:00:00 1970
+++ libelf/files/patch-Makefile.in	Fri Aug 19 16:52:34 2005
@@ -0,0 +1,11 @@
+--- Makefile.in.orig	Fri Aug 19 16:51:51 2005
++++ Makefile.in	Fri Aug 19 16:52:13 2005
+@@ -23,7 +23,7 @@
+ exec_prefix = @exec_prefix@
+ libdir = @libdir@
+ 
+-pkgdir = $(libdir)/pkgconfig
++pkgdir = $(prefix)/libdata/pkgconfig
+ 
+ MV = mv -f
+ RM = rm -f
diff -urN --exclude=CVS libelf.orig/files/patch-configure libelf/files/patch-configure
--- libelf.orig/files/patch-configure	Sun Dec 14 16:35:46 2003
+++ libelf/files/patch-configure	Fri Aug 19 16:05:58 2005
@@ -1,18 +1,15 @@
-
-$FreeBSD: ports/devel/libelf/files/patch-configure,v 1.4 2003/12/14 14:35:46 roam Exp $
-
---- configure.old	Sun Dec 14 14:11:54 2003
-+++ configure	Sun Dec 14 14:13:28 2003
-@@ -1139,7 +1139,7 @@
+--- configure.orig	Fri Aug 19 16:00:37 2005
++++ configure	Fri Aug 19 16:05:31 2005
+@@ -1142,7 +1142,7 @@
  
  fi
  
--for ac_hdr in unistd.h fcntl.h elf.h sys/elf.h link.h sys/link.h
-+for ac_hdr in unistd.h fcntl.h sys/elf.h link.h sys/link.h
+-for ac_hdr in unistd.h stdint.h fcntl.h
++for ac_hdr in unistd.h stdint.h fcntl.h elf.h
  do
  ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-@@ -3055,7 +3055,7 @@
+@@ -3218,7 +3218,7 @@
  fi
  
      case "$host" in
@@ -21,12 +18,12 @@
  	if test "$GCC" = yes; then
  	  
    
-@@ -3112,13 +3112,12 @@
- 	    then
- 	      SHLIB_SFX='-$(VERSION).so'
- 	    else
--	      SHLIB_SFX='.so.$(VERSION)'
-+	      SHLIB_SFX='.so.$(MAJOR)'
+@@ -3273,13 +3273,12 @@
+ 	    PICFLAGS='-fPIC -DPIC'
+ 	    if test "$mr_enable_gnu_names" = yes
+ 	    then SHLIB_SFX='-$(VERSION).so'
+-	    else SHLIB_SFX='.so.$(VERSION)'
++	    else SHLIB_SFX='.so.$(MAJOR)'
  	    fi
  	    SHLINK_SFX='.so'
  	    SONAME_SFX='.so.$(MAJOR)'
diff -urN --exclude=CVS libelf.orig/pkg-plist libelf/pkg-plist
--- libelf.orig/pkg-plist	Wed Jul 16 16:39:31 2003
+++ libelf/pkg-plist	Fri Aug 19 16:54:24 2005
@@ -6,5 +6,6 @@
 lib/libelf.a
 lib/libelf.so
 lib/libelf.so.%%LIBVER%%
+libdata/pkgconfig/libelf.pc
 share/locale/de/LC_MESSAGES/libelf.mo
 @dirrm include/libelf
--- libelf_0.8.5-0.8.6.diff ends here ---


If these will be added, post-patch: should be removed from Makefile


--- patch-lib::32.fsize.c begins here ---
--- lib/32.fsize.c.orig	Fri Aug 19 16:18:02 2005
+++ lib/32.fsize.c	Fri Aug 19 16:18:48 2005
@@ -68,8 +68,8 @@
 	    { sizeof(Elf64_Sword),    sizeof(__ext_Elf64_Sword)  },
 	    { sizeof(Elf64_Sym),      sizeof(__ext_Elf64_Sym)    },
 	    { sizeof(Elf64_Word),     sizeof(__ext_Elf64_Word)   },
-	    { sizeof(Elf64_Sxword),   sizeof(__ext_Elf64_Sxword) },
-	    { sizeof(Elf64_Xword),    sizeof(__ext_Elf64_Xword)  },
+	    { sizeof(Elf64_Sword),    sizeof(__ext_Elf64_Sxword) },
+	    { sizeof(Elf64_Word),     sizeof(__ext_Elf64_Xword)  },
 	    /* XXX: check Solaris values */
 	    { 0, 0 },	/* Elf64_Verdef/Verdaux size varies */
 	    { 0, 0 },	/* Elf64_Verneed/Vernaux size varies */
--- patch-lib::32.fsize.c ends here ---

--- patch-lib::64.xlatetof.c begins here ---
--- lib/64.xlatetof.c.orig	Fri Aug 19 16:23:56 2005
+++ lib/64.xlatetof.c	Fri Aug 19 16:24:25 2005
@@ -266,8 +266,8 @@
 copy_type(off_64,_,Elf64_Off,copy_off_11)
 copy_type(sword_64,_,Elf64_Sword,copy_sword_11)
 copy_type(word_64,_,Elf64_Word,copy_word_11)
-copy_type(sxword_64,_,Elf64_Sxword,copy_sxword_11)
-copy_type(xword_64,_,Elf64_Xword,copy_xword_11)
+copy_type(sxword_64,_,Elf64_Sword,copy_sxword_11)
+copy_type(xword_64,_,Elf64_Word,copy_xword_11)
 copy_type(dyn_64,11,Elf64_Dyn,copy_dyn_11)
 copy_type(ehdr_64,11,Elf64_Ehdr,copy_ehdr_11)
 copy_type(phdr_64,11,Elf64_Phdr,copy_phdr_11)
--- patch-lib::64.xlatetof.c ends here ---

--- patch-lib::cook.c begins here ---
--- lib/cook.c.orig	Fri Aug 19 16:21:53 2005
+++ lib/cook.c	Fri Aug 19 16:22:31 2005
@@ -245,7 +245,7 @@
 		/*
 		 * Check for overflow on 32-bit systems
 		 */
-		if (overflow(num, u.sh64.sh_size, Elf64_Xword)) {
+		if (overflow(num, u.sh64.sh_size, Elf64_Word)) {
 		    seterr(ERROR_OUTSIDE);
 		    return 0;
 		}
@@ -320,9 +320,9 @@
 		/*
 		 * Check for overflow on 32-bit systems
 		 */
-		if (overflow(scn->s_size, shdr->sh_size, Elf64_Xword)
+		if (overflow(scn->s_size, shdr->sh_size, Elf64_Word)
 		 || overflow(scn->s_offset, shdr->sh_offset, Elf64_Off)
-		 || overflow(sd->sd_data.d_align, shdr->sh_addralign, Elf64_Xword)) {
+		 || overflow(sd->sd_data.d_align, shdr->sh_addralign, Elf64_Word)) {
 		    seterr(ERROR_OUTSIDE);
 		    return 0;
 		}
--- patch-lib::cook.c ends here ---

--- patch-lib::gelf.h begins here ---
--- lib/gelf.h.orig	Fri Aug 19 16:15:19 2005
+++ lib/gelf.h	Fri Aug 19 16:17:04 2005
@@ -55,8 +55,8 @@
 typedef Elf64_Off	GElf_Off;
 typedef Elf64_Sword	GElf_Sword;
 typedef Elf64_Word	GElf_Word;
-typedef Elf64_Sxword	GElf_Sxword;
-typedef Elf64_Xword	GElf_Xword;
+typedef Elf64_Sword	GElf_Sxword;
+typedef Elf64_Word	GElf_Xword;
 
 typedef Elf64_Ehdr	GElf_Ehdr;
 typedef Elf64_Phdr	GElf_Phdr;
--- patch-lib::gelf.h ends here ---

--- patch-lib::gelftrans.c begins here ---
--- lib/gelftrans.c.orig	Fri Aug 19 16:25:13 2005
+++ lib/gelftrans.c	Fri Aug 19 16:26:15 2005
@@ -53,7 +53,7 @@
 # undef ELF64_R_INFO
 # define ELF64_R_SYM(i)		((i)>>32)
 # define ELF64_R_TYPE(i)	((i)&0xffffffffL)
-# define ELF64_R_INFO(s,t)	(((Elf64_Xword)(s)<<32)+((t)&0xffffffffL))
+# define ELF64_R_INFO(s,t)	(((Elf64_Word)(s)<<32)+((t)&0xffffffffL))
 #endif /* !defined(...) */
 
 static char*
@@ -256,8 +256,8 @@
 	Elf32_Rela *src = (Elf32_Rela*)tmp;
 
 	check_and_copy(GElf_Addr,   dst, src, r_offset, NULL);
-	dst->r_info = ELF64_R_INFO((Elf64_Xword)ELF32_R_SYM(src->r_info),
-				   (Elf64_Xword)ELF32_R_TYPE(src->r_info));
+	dst->r_info = ELF64_R_INFO((Elf64_Word)ELF32_R_SYM(src->r_info),
+				   (Elf64_Word)ELF32_R_TYPE(src->r_info));
 	check_and_copy(GElf_Sxword, dst, src, r_addend, NULL);
     }
     else {
@@ -327,8 +327,8 @@
 	Elf32_Rel *src = (Elf32_Rel*)tmp;
 
 	check_and_copy(GElf_Addr, dst, src, r_offset, NULL);
-	dst->r_info = ELF64_R_INFO((Elf64_Xword)ELF32_R_SYM(src->r_info),
-				   (Elf64_Xword)ELF32_R_TYPE(src->r_info));
+	dst->r_info = ELF64_R_INFO((Elf64_Word)ELF32_R_SYM(src->r_info),
+				   (Elf64_Word)ELF32_R_TYPE(src->r_info));
     }
     else {
 	seterr(ERROR_UNIMPLEMENTED);
--- patch-lib::gelftrans.c ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050819141340.GA4879>