From e6af332b3f7c96aa8bf90f3fb59f0fc01d82fc2d Mon Sep 17 00:00:00 2001 From: ensc Date: Fri, 4 Mar 2005 00:53:17 +0000 Subject: [PATCH] auto-import dietlibc-0.28-4 on branch devel from dietlibc-0.28-4.src.rpm --- .cvsignore | 1 + dietlibc-0.28-gcc4.patch | 54 +++++++++++++ dietlibc.spec | 159 +++++++++++++++++++++++++++++++++++++++ sources | 1 + 4 files changed, 215 insertions(+) create mode 100644 dietlibc-0.28-gcc4.patch create mode 100644 dietlibc.spec diff --git a/.cvsignore b/.cvsignore index e69de29..8c19236 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +dietlibc-0.28.tar.bz2 diff --git a/dietlibc-0.28-gcc4.patch b/dietlibc-0.28-gcc4.patch new file mode 100644 index 0000000..71d0b69 --- /dev/null +++ b/dietlibc-0.28-gcc4.patch @@ -0,0 +1,54 @@ +--- dietlibc-0.28/libdl/_dl_int.h.gcc4 2005-01-29 03:29:16.000000000 +0100 ++++ dietlibc-0.28/libdl/_dl_int.h 2005-03-04 01:39:26.336802965 +0100 +@@ -102,7 +102,7 @@ struct r_debug { + Elf_Addr r_ldbase; + }; + #ifdef WANT_LD_SO_GDB_SUPPORT +-extern struct r_debug _r_debug; ++ //extern struct r_debug _r_debug; + #endif + + #define HASH_BUCKET_LEN(p) (*((p))) +@@ -112,9 +112,9 @@ extern struct r_debug _r_debug; + #define HASH_CHAIN(p) ((p)+2+HASH_BUCKET_LEN(p)) + + /* _dl_alloc.c */ +-extern struct _dl_handle* _dl_root_handle; +-extern struct _dl_handle* _dl_top_handle; +-extern struct _dl_handle* _dl_free_list; ++//extern struct _dl_handle* _dl_root_handle; ++//extern struct _dl_handle* _dl_top_handle; ++//extern struct _dl_handle* _dl_free_list; + #ifndef __DIET_LD_SO__ + void _dl_free_handle(struct _dl_handle* dh); + struct _dl_handle* _dl_get_handle(); +--- dietlibc-0.28/libdl/_dl_main.c.gcc4 2005-01-29 03:29:16.000000000 +0100 ++++ dietlibc-0.28/libdl/_dl_main.c 2005-03-04 01:40:41.886679465 +0100 +@@ -168,9 +168,11 @@ static inline unsigned long* get_got(voi + return got; + } + ++/* declare _dl_jump static otherwise we have a GOT access BEFOR we have the resolver */ ++static void _dl_jump(void); ++ + static inline int work_on_pltgot(struct _dl_handle*dh) { +- /* declare _dl_jump static otherwise we have a GOT access BEFOR we have the resolver */ +- static void _dl_jump(void); ++ + if ((dh->plt_rel)&&(!(dh->flags&RTLD_NOW))) { + unsigned long*tmp=dh->pltgot; + /* GOT */ +--- dietlibc-0.28/dyn_start.c.gcc4 2004-11-30 23:35:14.000000000 +0100 ++++ dietlibc-0.28/dyn_start.c 2005-03-04 01:44:23.346109645 +0100 +@@ -29,10 +29,10 @@ int stackgap(int argc,char* argv[],char* + + #ifndef __DYN_LIB_SHARED + /* pre main, post _start */ ++static __attribute__((section(".init"))) void _init(void); + int _dyn_start(int argc, char **argv, char **envp, structor dl_init); + int _dyn_start(int argc, char **argv, char **envp, structor dl_init) + { +- static __attribute__((section(".init"))) void _init(void); + int main(int argc, char **argv, char **envp); + + if (dl_init) atexit(dl_init); diff --git a/dietlibc.spec b/dietlibc.spec new file mode 100644 index 0000000..a4eb143 --- /dev/null +++ b/dietlibc.spec @@ -0,0 +1,159 @@ +## $Id: dietlibc.spec,v 1.3 2005/02/01 12:03:17 ensc Exp $ + +## This package understands the following switches: +## --with cross ... enable crossbuild +## --define crossarch ... set cross-architecture (only valid with +## '--with cross'; defaults to 'arm-linux') + +## Fedora Extras specific customization below... +%global crossarch %{!?crossarch:arm-linux}%{?crossarch} +## + +%global NAME dietlibc +%global do_crossbuild %{?_with_cross:1}%{!?_with_cross:0} + +%{!?release_func:%define release_func() %1%{?disttag}} + +Summary: A small libc implementation +Name: %{?_with_cross:cross-%crossarch-}%NAME +Version: 0.28 +Release: %release_func 4 +License: GPL +Group: Development/Libraries +URL: http://www.fefe.de/dietlibc/ +Source0: http://www.fefe.de/dietlibc/%NAME-%version.tar.bz2 +Patch0: dietlibc-0.28-gcc4.patch +BuildRoot: %_tmppath/%name-%version-buildroot +Requires: dietlibc-lib = %version-%release + +%if %do_crossbuild +BuildRequires: dietlibc +Requires: dietlibc = %version-%release +%endif + + +%package lib +Summary: Dynamic libraries for dietlibc +Group: System Environment/Libraries + +%description +The diet libc is a libc that is optimized for small size. It can be +used to create small statically linked binaries for Linux on alpha, +arm, hppa, ia64, i386, mips, s390, sparc, sparc64, ppc and x86_64. + + +%description lib +The diet libc is a libc that is optimized for small size. It can be +used to create small statically linked binaries for Linux on alpha, +arm, hppa, ia64, i386, mips, s390, sparc, sparc64, ppc and x86_64. + +This package contains the dynamic libraries for dietlibc. + + +%prep +%setup -q -n %NAME-%version +%patch0 -p1 -b .gcc4 + +## only for 0.28; remove it in 0.29 +sed -i -e 's!LD_RUN_PATH= !env -u LD_RUN_PATH !' Makefile + + +%define basemakeflags prefix=%_libdir/dietlibc BINDIR=%_bindir MAN1DIR=%_mandir/man1 COMMENT=: %{!?_with_cross:CFLAGS="$RPM_OPT_FLAGS"} +%define xtraflags %(echo CROSS=%{crossarch}- ARCH=$(echo %crossarch | sed -e 's!-.*!!')) +%define makeflags %basemakeflags %{?_with_cross:%xtraflags} + + +%build +%if %do_crossbuild + mkdir bin-%_arch + diet gcc diet.c -DDIETHOME=\"`pwd`\" -DVERSION=\"X\" -o bin-%_arch/diet +%endif + +%__make %makeflags all dyn %_smp_mflags + + + +%install +rm -rf $RPM_BUILD_ROOT +%__install -d -m755 $RPM_BUILD_ROOT/etc +%__make %makeflags DESTDIR=$RPM_BUILD_ROOT install + +%if !%do_crossbuild + ln -s lib-%_arch ${RPM_BUILD_ROOT}%_libdir/dietlibc/lib-%_arch-%_vendor +%endif + +%if %do_crossbuild + rm -rf ${RPM_BUILD_ROOT}%_libdir/dietlibc/include \ + ${RPM_BUILD_ROOT}%_mandir +%endif + + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root,-) +%exclude %_libdir/dietlibc/*/*.so + +%if %do_crossbuild +%_libdir/dietlibc/lib-* +%else +%doc AUTHOR BUGS CAVEAT CHANGES COPYING FAQ PORTING README +%doc THANKS TODO +%doc %_mandir/*/* +%_bindir/* +%_libdir/dietlibc +%endif + + +%files lib +%defattr(-,root,root,-) +%config(noreplace) %_sysconfdir/* +%dir %_libdir/dietlibc +%dir %_libdir/dietlibc/lib-* +%_libdir/dietlibc/lib-%_arch/*.so + + +%changelog +* Fri Mar 4 2005 Enrico Scholz - 1:0.28-4 +- rebuild +- fixed compilation with gcc4 + +* Tue Feb 1 2005 Enrico Scholz - 1:0.28-1 +- updated to 0.28 +- unset LD_RUN_PATH which would result in empty rpaths else +- removed the waitpid patch; it is solved upstream + +* Tue Aug 17 2004 Enrico Scholz - 1:0.27-1 +- updated to 0.27 + +* Fri Jun 11 2004 Enrico Scholz - 1:0.26-1 +- updated to 0.26 + +* Fri Apr 9 2004 Enrico Scholz - 1:0.25-1 +- updated to 0.25 + +* Sat Jan 17 2004 Enrico Scholz - 1:%VERSION.90.%DATE}-5 +- renewed -snprintf patch + +* Tue Jan 6 2004 Enrico Scholz - 1:%VERSION.90.%DATE}-4 +- applied -snprintf patch (from fedora dietlibc-0.24-2 package) + +* Tue Dec 30 2003 Enrico Scholz - 1:%VERSION.90.%DATE}-2 +- added C99 patch + +* Thu Dec 4 2003 Enrico Scholz - 1:0.24-1 +- updated to 0.24 + +* Tue Sep 16 2003 Enrico Scholz - 1:0.23-1 +- updated to 0.23 + +* Fri Nov 8 2002 Enrico Scholz 1:0.21-1 +- updated to 0.21 +- removed unpackaged files in %%install-stage + +* Thu Jul 11 2002 Enrico Scholz 1:0.18-1 +- updated to 0.18 + +* Thu Jul 4 2002 Enrico Scholz +- Initial build. diff --git a/sources b/sources index e69de29..0707c4a 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +5be8e221a438817f83f73d09ce655883 dietlibc-0.28.tar.bz2