- Restore multilib devel goodness patch (make allegro-devel i386 and x86_64

parallel installable)
- Restore execstack patch so that binaries linked against allegro do not
    require an execstack and thus work under selinux (without this
    liballeg_unshareable.a contains object files which require an
    executable stack which will end up in any app linked against allegro)
- Make alleg-dga2.so plugin 100% PIC so it can load with selinux enabled
- Mark alleg-vga.so plugin as textrel_shlib_t as it isn't 100% PIC and
    cannot be fixed (easily) to be 100% PIC
This commit is contained in:
Hans de Goede 2007-01-12 15:53:12 +00:00
commit ebca71b2d9
3 changed files with 121 additions and 7 deletions

View file

@ -1,12 +1,10 @@
--- allegro-4.2.0/src/x/xdga2s.s.noexecstack 2004-08-27 15:54:05.000000000 +0200
+++ allegro-4.2.0/src/x/xdga2s.s 2006-07-06 17:22:04.000000000 +0200
@@ -48,6 +48,7 @@
ret
@@ -50,4 +50,5 @@
#endif
#endif
+.section .note.GNU-stack,"",@progbits
#endif
#endif
--- allegro-4.2.0/src/x/xwins.s.noexecstack 2004-09-03 11:30:45.000000000 +0200
+++ allegro-4.2.0/src/x/xwins.s 2006-07-06 17:22:04.000000000 +0200
@ -205,3 +203,31 @@
ret
+.section .note.GNU-stack,"",@progbits
--- allegro-4.2.1/src/misc/modexgfx.s~ 2006-12-22 14:59:08.000000000 +0100
+++ allegro-4.2.1/src/misc/modexgfx.s 2006-12-22 14:59:08.000000000 +0100
@@ -1688,3 +1688,4 @@
#endif /* (!defined ALLEGRO_LINUX) || ((defined ALLEGRO_LINUX_VGA) && ... */
+.section .note.GNU-stack,"",@progbits
--- allegro-4.2.1/src/misc/vbeafs.s~ 2006-12-22 14:59:03.000000000 +0100
+++ allegro-4.2.1/src/misc/vbeafs.s 2006-12-22 14:59:03.000000000 +0100
@@ -188,3 +188,4 @@
#endif /* ifdef VBE/AF is cool on this platform */
+.section .note.GNU-stack,"",@progbits
--- allegro-4.2.1/src/linux/svgalibs.s~ 2006-12-22 15:00:44.000000000 +0100
+++ allegro-4.2.1/src/linux/svgalibs.s 2006-12-22 15:00:44.000000000 +0100
@@ -65,3 +65,4 @@
#endif
#endif
+.section .note.GNU-stack,"",@progbits
--- allegro-4.2.1/src/c/cmiscs.s~ 2006-12-22 15:00:40.000000000 +0100
+++ allegro-4.2.1/src/c/cmiscs.s 2006-12-22 15:00:40.000000000 +0100
@@ -33,3 +33,4 @@
FUNC(_stub_bank_switch_end)
ret
+.section .note.GNU-stack,"",@progbits

View file

@ -0,0 +1,47 @@
--- allegro-4.2.1/src/x/xdga2s.s~ 2006-12-22 16:14:41.000000000 +0100
+++ allegro-4.2.1/src/x/xdga2s.s 2006-12-22 16:14:41.000000000 +0100
@@ -24,7 +24,7 @@
.text
-
+#if 0 /* this is non PIC and we have a C alternative, so don't use it! */
#if (!defined ALLEGRO_NO_ASM) && (defined ALLEGRO_XWINDOWS_WITH_XF86DGA2)
#if (!defined ALLEGRO_WITH_MODULES) || (defined ALLEGRO_MODULE)
@@ -50,5 +50,6 @@
#endif
#endif
+#endif
.section .note.GNU-stack,"",@progbits
--- allegro-4.2.1/src/x/xdga2.c~ 2006-12-22 16:17:40.000000000 +0100
+++ allegro-4.2.1/src/x/xdga2.c 2006-12-22 16:17:40.000000000 +0100
@@ -49,7 +49,7 @@
static void _xdga2_acquire(BITMAP *bmp);
static GFX_MODE_LIST *_xdga2_fetch_mode_list(void);
-#ifdef ALLEGRO_NO_ASM
+#if 1 /* the asm is non PIC and we have a C alternative, so don't use it! */
uintptr_t _xdga2_write_line(BITMAP *bmp, int line);
#else
uintptr_t _xdga2_write_line_asm(BITMAP *bmp, int line);
@@ -559,7 +559,7 @@
/* Hardware acceleration has been requested */
/* Updates line switcher to accommodate framebuffer synchronization */
-#ifdef ALLEGRO_NO_ASM
+#if 1 /* the asm is non PIC and we have a C alternative, so don't use it! */
bmp->write_bank = _xdga2_write_line;
bmp->read_bank = _xdga2_write_line;
#else
@@ -816,7 +816,7 @@
}
-#ifdef ALLEGRO_NO_ASM
+#if 1 /* the asm is non PIC and we have a C alternative, so don't use it! */
/* _xdga2_write_line:
* Returns new line and synchronizes framebuffer if needed.

View file

@ -1,6 +1,6 @@
Name: allegro
Version: 4.2.1
Release: 1%{?dist}
Release: 2%{?dist}
Summary: A game programming library
Summary(es): Una libreria de programacion de juegos
@ -15,12 +15,19 @@ Source: http://download.sourceforge.net/alleg/allegro-%{version}.tar.gz
Patch1: allegro-4.0.3-libdir.patch
Patch2: allegro-4.0.3-cfg.patch
Patch3: allegro-4.2.0-nostrip.patch
Patch4: allegro-4.2.0-noexecstack.patch
Patch5: allegro-4.2.0-multilib.patch
Patch6: allegro-4.2.1-noexecmod.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: esound-devel, texinfo, perl, arts-devel
BuildRequires: xorg-x11-proto-devel, libX11-devel, libXext-devel, libXt-devel
BuildRequires: libXpm-devel, libXcursor-devel, libXxf86vm-devel
BuildRequires: libXxf86dga-devel, autoconf
Requires: timidity++
%ifarch %{ix86}
Requires(post): policycoreutils /sbin/ldconfig
Requires(postun): policycoreutils /sbin/ldconfig
%endif
%description
Allegro is a cross-platform library intended for use in computer games
@ -122,6 +129,9 @@ které jsou užitečné pro vývoj Allegro programů.
%patch1 -p1 -b .libdir
%patch2 -p1 -b .config
%patch3 -p1 -z .nostrip
%patch4 -p1 -z .noexecstack
%patch5 -p1 -z .multilib
%patch6 -p1 -z .noexecmod
%build
@ -152,9 +162,29 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/dir
rm -f $RPM_BUILD_ROOT%{_libdir}/liball{p,d}_unsharable.a
%ifarch %{ix86}
%post
/sbin/ldconfig
# Set SELinux file_context for vga plugin in the policy
semanage fcontext -a -t textrel_shlib_t \
'%{_libdir}/allegro/4\.2\.1/alleg-vga\.so' 2>/dev/null || :
# Actually change the context
chcon -t textrel_shlib_t %{_libdir}/allegro/%{version}/alleg-vga.so || :
%else
%post -p /sbin/ldconfig
%endif
%postun -p /sbin/ldconfig
%ifarch %{ix86}
%postun
/sbin/ldconfig
# SELinux support
if [ $1 -eq 0 ]; then # final removal
semanage fcontext -d -t textrel_shlib_t \
'%{_libdir}/allegro/4\.2\.1/alleg-vga\.so' 2>/dev/null || :
fi
%else
%postun -p /sbin/ldconfig
%endif
%post devel
/sbin/install-info %{_infodir}/allegro.info %{_infodir}/dir 2>/dev/null || :
@ -210,6 +240,17 @@ rm -rf $RPM_BUILD_ROOT
%changelog
* Fri Dec 22 2006 Hans de Goede <j.w.r.degoede@hhs.nl> 4.2.1-2
- Restore multilib devel goodness patch (make allegro-devel i386 and x86_64
parallel installable)
- Restore execstack patch so that binaries linked against allegro do not
require an execstack and thus work under selinux (without this
liballeg_unshareable.a contains object files which require an executable
stack which will end up in any app linked against allegro)
- Make alleg-dga2.so plugin 100% PIC so it can load with selinux enabled
- Mark alleg-vga.so plugin as textrel_shlib_t as it isn't 100% PIC and cannot
be fixed (easily) to be 100% PIC
* Tue Nov 28 2006 Jindrich Novy <jnovy@redhat.com> 4.2.1-1
- update to 4.2.1