%define _unpackaged_files_terminate_build 1 %define newlib_version 1.15.0 Summary: SPU C library Name: spu-newlib Version: %{newlib_version} Release: 82 License: GPL Group: Cell Development Libraries Source0: newlib-1.15.0-20070621.tar.bz2 Patch1: spu_define_posix_libm.patch Patch2: fp_ilogb0_value.patch Patch3: new_malloc.patch Patch4: shm.patch Patch5: dirfuncs.patch Patch6: misc_funcs.patch Patch7: readfuncs.patch Patch8: ea_local_store.patch Patch9: crt0_deps.patch Patch10: ea1.patch Patch11: ea2.patch Patch12: ea3.patch Patch13: ea4.patch Patch14: ea5.patch Patch15: libm_scalar_headers.patch Patch16: libm_scalar_c_files.patch Patch17: libm_vec_headers.patch Patch18: libm_vec_mods.patch Patch20: libm_scalar_using_vec.patch Patch21: libm_vec_c_files.patch Patch22: domain-checks.patch Patch23: ea6.patch Patch24: round.patch Patch25: 36457.patch Patch26: 36454.patch Patch27: 36824.patch Patch28: remove.patch Patch29: malloc0revised.patch Patch30: add_eaddr_mmap_calls.patch Patch31: 37248.patch Patch32: malloc64bit.patch Patch33: off_t.patch Patch34: 37921.patch Patch35: mallocr_38109.patch Patch36: fix_sizes_38107.patch Patch37: change_fpos_t_size_38353.patch Patch38: sbrk_use_current_sp_38742.patch Patch39: round_up_malloc_size_38824.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: texinfo BuildRequires: spu-gcc >= 4.1.1-107 # Don't strip as the host binutils may be unable to handle SPU objects. %define __os_install_post /usr/lib/rpm/brp-compress # When building the cross-toolchain, reset prefix directory and use sysroot %ifnarch ppc ppc64 %define _prefix /opt/cell/sysroot/usr %define _mandir %{_prefix}/man %define _infodir %{_prefix}/info %define with_sysroot --with-sysroot=/opt/cell/sysroot %endif %description The spu-newlib package contains the newlib C library version %{newlib_version}. %prep %setup -c -q # Use newlib-%{newlib_version} if we ever switch back to release tar # balls. # pushd newlib-%{newlib_version} pushd src %patch1 -p1 %patch2 -p1 %patch3 -p1 %patch4 -p1 %patch5 -p1 %patch6 -p1 %patch7 -p1 %patch8 -p1 %patch9 -p1 %patch10 -p1 %patch11 -p1 %patch12 -p1 %patch13 -p1 %patch14 -p1 %patch15 -p1 %patch16 -p1 %patch17 -p1 %patch18 -p1 %patch20 -p1 %patch21 -p1 %patch22 -p1 %patch23 -p1 %patch24 -p1 %patch25 -p1 %patch26 -p1 %patch27 -p1 %patch28 -p1 %patch29 -p1 %patch30 -p1 %patch31 -p1 %patch32 -p1 %patch33 -p1 %patch34 -p1 %patch35 -p1 %patch36 -p1 %patch37 -p1 %patch38 -p1 %patch39 -p1 popd %build %define spu_target_platform spu %define spu_prefix spu- rm -fr obj-%{spu_target_platform} mkdir obj-%{spu_target_platform} cd obj-%{spu_target_platform} OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g'` SPU_OPT_FLAGS="-O2 -g -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" CC="gcc $OPT_FLAGS -DBPA" # Note that using the cvs snapshot, we end up with a top level of "src" # rather than "newlib-${version}" that we get with a released tar ball. CC="$CC" CFLAGS="$SPU_OPT_FLAGS" CXXFLAGS="$SPU_OPT_FLAGS" XCFLAGS="$OPT_FLAGS" TCFLAGS="$SPU_OPT_FLAGS" \ ../src/configure --prefix=%{_prefix} \ --mandir=%{_mandir} --infodir=%{_infodir} \ %{?with_sysroot} \ --disable-shared --disable-threads --disable-checking --with-headers \ --with-system-zlib \ --disable-multilib --disable-nls \ --enable-version-specific-runtime-libs \ --program-prefix=%{spu_prefix} \ --target=%{spu_target_platform} # Currently the newlib Makefile is not parallel-make safe. #make %{?_smp_mflags} make %install rm -fr $RPM_BUILD_ROOT TARGET_PLATFORM=%{spu_target_platform} make -C obj-%{spu_target_platform} DESTDIR=$RPM_BUILD_ROOT install # Info files conflict with host toolchain files, just remove them for # now. rm -rf $RPM_BUILD_ROOT%{_infodir} %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %dir %{_prefix} %dir %{_prefix}/%{spu_target_platform} %dir %{_prefix}/%{spu_target_platform}/include %dir %{_prefix}/%{spu_target_platform}/include/machine %dir %{_prefix}/%{spu_target_platform}/include/sys %dir %{_prefix}/%{spu_target_platform}/lib %{_prefix}/%{spu_target_platform}/include/*.h %{_prefix}/%{spu_target_platform}/include/machine/*.h %{_prefix}/%{spu_target_platform}/include/sys/*.h %{_prefix}/%{spu_target_platform}/lib/*.[ao] %changelog * Tue Sep 25 2007 Ben Elliston 1.15.0-82 - Require spu-gcc >= 4.1.1-107 when building (bug #38067). * Fri Sep 14 2007 Patrick Mansfield 1.15.0-81 Fix malloc to always use mod 16 byte size requests to sbrk(), so we always get properly aligned addresses from sbrk (bug #38824). * Fri Sep 14 2007 Patrick Mansfield 1.15.0-80 Use the current stack pointer rather than the maximum amount of memory in sbrk to determine the amount of heap space left (bug #38742). * Tue Sep 4 2007 Patrick Mansfield 1.15.0-79 Change fpos_t to be 16 bytes (bug #38353). * Mon Aug 28 2007 Patrick Mansfield 1.15.0-78 Change uid_t, gid_t and dev_t to be 4 bytes long (bug #38107). * Mon Aug 28 2007 Patrick Mansfield 1.15.0-77 Fix so SPU malloc and related routines are always used (bug #38109). * Mon Aug 20 2007 Ulrich Weigand 1.15.0-76 Fix computation of available stack size in -mstdmain mode (#37921). * Mon Aug 13 2007 Joel Schopp 1.15.0-75 Make offset argument to mmap_ea be type off_t not off_ea_t. * Mon Aug 13 2007 Patrick Mansfield 1.15.0-74 Use the vector powf4() function to implement the scalar powf(), this fixes powf() with a negative basis (also part of bug #36124). * Mon Aug 13 2007 Patrick Mansfield 1.15.0-73 Refresh to the SIMD math source based on a snapshot of Aug 13 2007. This fixes bugs with atan2 (#37173), and fixes pow() (but not powf) with a negative base (#36124). * Sun Aug 11 2007 Joel Schopp 1.15.0-72 Make all 0x2105 calls have 64 bit arguments. * Mon Aug 08 2007 Ulrich Weigand 1.15.0-71 Provide MAP_FAILED_EADDR and MAP_FAILED_EA instead of of MAP_FAILED. Adapt and fix mmap_ea32 / mremap_ea32 implementations. (#37248) * Thu Aug 03 2007 Patrick Mansfield 1.15.0-70 Add mmap_eaddr, mremap_eaddr, msync_eaddr, and munmap_eaddr. Modify mmap_ea, mremap_ea, munmap_ea, and msync_ea to call the corresponding nnn_eaddr functions. * Thu Aug 02 2007 Joel Schopp 1.15.0-69 The change in -67 was technically correct, but it turns out newlib default allocator and glibc treat malloc(0) as malloc(1), so change behavior to match. * Wed Aug 01 2007 Joel Schopp 1.15.0-68 Remove sysv shared memory functions as they are not supported on the ppe and there is no demand for them. * Wed Jul 25 2007 Joel Schopp 1.15.0-67 Fix malloc(0) to behave itself. Users amaze me. * Mon Jul 23 2007 Joel Schopp 1.15.0-66 Add a sys/mman.h for the spu, put some flags there and two functions that were in ea.h * Mon Jul 23 2007 Patrick Mansfield 1.15.0-65 Rebase to current SIMD math source. The new source includes the fix for tan double, so that patch has been dropped. The source also includes proper copyrights and attributions. * Mon Jul 16 2007 Joel Schopp 1.15.0-64 Instead of declaring getpagesize extern just include the file where it is properly declared. * Mon Jul 16 2007 Joel Schopp 1.15.0-63 Fix rounding macros/staic inlines in ea_internal.h. Thanks to Jack for finding these * Mon Jul 09 2007 Joel Schopp 1.15.0-62 Change 0x2104 to 0x2105 due to kernel conflict. * Mon Jul 09 2007 Ulrich Weigand 1.15.0-61 Move cross-prefix to /opt/cell/sysroot/usr. * Sun Jul 08 2007 Joel Schopp 1.15.0-59 More newlib bugfixes. * Sun Jul 08 2007 Joel Schopp 1.15.0-59 Turn 64 bit strstr back on thanks to compiler bugfix. Fix some other misc bugs, mostly related to -mea64 * Thu Jul 05 2007 Joel Schopp 1.15.0-58 Somehow some 64 bit make changes didn't get checked in in 51 while cvs was down. Check in again. * Tue Jul 03 2007 Patrick Mansfield 1.15.0-57 Fix SPU math tan double again, the sign bit was not properly masked causing bit 32 to sometimes be wrong. * Tue Jul 03 2007 Patrick Mansfield 1.15.0-56 Fix SPU math erfc, it was declared float, but it is double. * Mon Jul 02 2007 Patrick Mansfield 1.15.0-55 Add domain checks to SPU scalar optimized math functions. * Mon Jul 02 2007 Patrick Mansfield 1.15.0-54 Sync with SIMD math files from an export of the files on July 2, 2007. Scalar optimal SPU math functions should be the same as before this change. * Mon Jul 02 2007 Ulrich Weigand 1.15.0-53 Fix build break due to missing include directive in Makefile. Include , not . Disable parallel make for now. * Mon Jul 02 2007 Joel Schopp 1.15.0-52 Finish feature set of libea. * Mon Jul 02 2007 Joel Schopp 1.15.0-51 Enable -mea64 of string functions, making all libea related functions compiled with -mea32 and -mea64. * Mon Jul 02 2007 Markus Deuling 1.15.0-50 Add build requirement spu-gcc >= release 66. * Fri Jun 29 2007 Joel Schopp 1.15.0-49 Move ea.h so it actually gets exported for users. Add more function definitions to ea.h as well. * Fri Jun 29 2007 Joel Schopp 1.15.0-48 Fix 32 bit return values for malloc, calloc, & realloc * Thu Jun 28 2007 Joel Schopp 1.15.0-47 Add spu side support for calloc_ea(),free_ea(),malloc_ea(),and realloc_ea(). Still need support on the PPE side in libspe2. * Wed Jun 27 2007 Joel Schopp 1.15.0-46 Enable -mea64 versions of some functions. * Wed Jun 27 2007 Joel Schopp 1.15.0-45 Add 15 more libea functions, all of which depend on -mea32 and cache functionality in gcc. * Wed Jun 27 2007 Patrick Mansfield 1.15.0-44 Define _POSIX_MODE in newlib configure.host rather than defining _IEEE_LIBM. This way, we get POSIX and C99 handling of errno for math function domain and range checks. * Tue Jun 26 2007 Joel Schopp 1.15.0-43 Add some libea functions that don't depend on cache code. More specifically mmap_ea, munmap_ea, mremap_ea, msync_ea, ftok_ea, shmget_ea, shmctl_ea, shmat_ea, & shmdt_ea. * Fri Jun 21 2007 Patrick Mansfield 1.15.0-42 Rebase against cvs newlib, used: cvs export -D "2007-06-21 22:00 GMT". Updated patch lists, removed old patches, combined all malloc changes into one patch, added code to set SPU specific FP_ILOGB0 (use INT_MIN rather than -INT_MAX). * Wed Jun 20 2007 Patrick Mansfield 1.15.0-41 Add Markus Deuling's crt0.S code to initialize __ea_local_store via register 6. * Tue Jun 19 2007 Patrick Mansfield 1.15.0-40 Add pread, pwrite, readv and writev via assist calls. * Mon Jun 18 2007 Patrick Mansfield 1.15.0-39 Add sched_yield, umask, utime and utimes via assist calls. * Mon Jun 18 2007 Patrick Mansfield 1.15.0-38 Pass errno as the second argument to the perror assist call. * Mon Jun 18 2007 Patrick Mansfield 1.15.0-37 Update to use opendir and related assisted calls that use a 64 bit PPU DIR value. * Wed Jun 13 2007 Patrick Mansfield 1.15.0-36 Use MAXNAMLEN in dirent.h, and set it to 255. * Tue Jun 12 2007 Patrick Mansfield 1.15.0-35 Via assist calls and some help in newlib source, add support for: opendir, closedir, readdir, rewinddir, seekdir, and telldir. * Tue Jun 12 2007 Joel Schopp 1.15.0-34 Fix trivial bug in shm checkin * Tue Jun 12 2007 Joel Schopp 1.15.0-33 Add shm_open() and shm_unlink() to libgloss. * Mon Jun 11 2007 Joel Schopp 1.15.0-32 Make malloc handle insane values more gracefully. Set errno to ENOMEM when returning NULL. * Mon Jun 11 2007 Patrick Mansfield 1.15.0-31 Use assist calls to implement mkstemp and mktemp rather than the previous solution that used copies of existing newlib functions. * Mon Jun 05 2007 Patrick Mansfield 1.15.0-30 Via assist calls, add support for: sync, fsync, fdatasync, dup2, lockf, and truncate. * Mon Jun 04 2007 Patrick Mansfield 1.15.0-29 Via assist calls, add support for: link, symlink and readlink. * Mon Jun 04 2007 Patrick Mansfield 1.15.0-28 Add lstat support via an assist call. * Mon Jun 04 2007 Patrick Mansfield 1.15.0-27 Add support for getcwd, allocate and free as needed on the SPU side, and then use the getcwd assist call. * Mon Jun 04 2007 Patrick Mansfield 1.15.0-26 Via assist calls, add support for: chdir, fchdir, mkdir, mknod, rmdir, chmod, fchmod, chown, fchown, and lchown. * Tue May 29 2007 Joel Schopp 1.15.0-25 Fix memory leak in realloc caused by creating double headers in the address tracker. * Wed May 25 2007 Patrick Mansfield 1.15.0-24 Add back setjmp.S, it was dropped when mktemp.c was added. * Wed May 24 2007 Patrick Mansfield 1.15.0-23 Add getpagesize() assist call. * Wed May 24 2007 Patrick Mansfield 1.15.0-22 Copy libc/posix/creat.c to libc/machine/spu to add creat(). This just calls open(), so we will never use the creat assist call. * Wed May 24 2007 Patrick Mansfield 1.15.0-21 Add nanosleep assist call, add sleep and usleep calls. * Wed May 23 2007 Patrick Mansfield 1.15.0-20 Copy libc/stdio/mktemp.c to libc/machine/spu so we get back mkstemp and mktemp. * Wed May 23 2007 Patrick Mansfield 1.15.0-19 Move libgloss functions specific structs and defines out of jsre.h into the C files that use them, similar to our libc assist calls. * Wed May 23 2007 Patrick Mansfield 1.15.0-18 Change __send_to_ppe to return an int (the return value of the assist call). * Sat May 19 2007 Joel Schopp 1.15.0-17 Add an initial implementation of realloc, fix a bug in free(0), clean up a comment. IBM bugzilla bug 35078. * Fri May 18 2007 Ulrich Weigand 1.15.0-16 - Change cross-prefix to /opt/cell/toolchain. Do not change sysroot. - Change group tag to "Cell Development Libraries". * Fri May 11 2007 Joel Schopp 1.15.0-15 Add a new memory allocator that is smaller and more efficient. * Wed May 09 2007 Patrick Mansfield 1.15.0-14 Fix for open not properly setting the mode argument. * Wed Apr 26 2007 Patrick Mansfield 1.15.0-13 Drop the hack test patches, and change the patch order a bit, putting the most likely to be pushed patches first. * Wed Apr 26 2007 Patrick Mansfield 1.15.0-12 Add a spu sys/errno.h so spu values match those on ppc linux for assisted calls. * Wed Apr 26 2007 Patrick Mansfield 1.15.0-11 Add SPU support for non-compliance with ieee for single precision floating point nan and infinities. * Wed Apr 19 2007 Patrick Mansfield 1.15.0-10 Fix feholdexcept bug, in feholdexcept.h use *envp not env. * Wed Apr 6 2007 Patrick Mansfield 1.15.0-9 Sync with the accepted version of the send_to_ppe patch that adds a syscall.h rather than a send_to_ppe.h, and apply the patch earlier in the sequence. * Wed Mar 22 2007 Patrick Mansfield 1.15.0-8 Rebase against cvs newlib: cvs export -D "2007-03-21 17:00 GMT"; removed accepted patches; combined all SPU math patches into two patches; moved helper files for SPU math work to sw/projects/toolchain/import-sdk-math-scripts; use .patch suffix for all patch files. * Thu Feb 22 2007 Ben Elliston 1.15.0-7 - sbrk now adjusts the stack pointer vector correctly so that GCC runtime stack checking works. * Tue Feb 20 2007 Patrick Mansfield 1.15.0-6 - Change configure.host default to build without atexit malloc for smaller code sizes. * Thu Feb 01 2007 Patrick Mansfield 1.15.0-4 - Apply patches from Vlad Zbarsky so - we have a single __send_to_ppe that is an external function. * Mon Jan 22 2007 Ben Elliston 1.15.0-3 - Change the cross-prefix to /opt/cell. * Fri Jan 19 2007 Ben Elliston 1.15.0-2 - Remove quilt from BuildRequires packages. - Do not link newlib-1.15.0 -> src. Update reference to src directory. - Package %{_prefix}/%{spu_target_platform}/include/{machine,sys}. * Fri Jan 12 2007 Ben Elliston 1.15.0-1 - Separate newlib from the monolithic toolchain RPM.