rpms/perl-CGI-SpeedyCGI/F-9 perl-CGI-SpeedyCGI-2.22-c99_inline.patch, NONE, 1.1 perl-CGI-SpeedyCGI.spec, 1.2, 1.3

Robert Scheck robert at fedoraproject.org
Sun Oct 12 21:01:21 UTC 2008


Author: robert

Update of /cvs/pkgs/rpms/perl-CGI-SpeedyCGI/F-9
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv876/F-9

Modified Files:
	perl-CGI-SpeedyCGI.spec 
Added Files:
	perl-CGI-SpeedyCGI-2.22-c99_inline.patch 
Log Message:
Work around C99 inline issues caused by C99 inline support in
newer GCC versions (#464963, thanks to Andreas Thienemann)


perl-CGI-SpeedyCGI-2.22-c99_inline.patch:

--- NEW FILE perl-CGI-SpeedyCGI-2.22-c99_inline.patch ---
Patch by Andreas Thienemann <andreas at bawue.net> for perl-CGI-SpeedyCGI >= 2.22, to get it building
with GCC versions supporting c99 inline. GCC seems to have changed it's understanding of inline
functions which are optimized into oblivion. The patch changes these inline functions into external
ones, making the thing compile. It's dirty and someone should fix it up in order to be conditional
or so depending on the compiler understanding of inlineness, but it should work for now. Further
information and references:

 - http://www.greenend.org.uk/rjk/2003/03/inline.html
 - http://www.nabble.com/inline-functions-with-gnu99-td16231641.html
 - https://bugzilla.redhat.com/show_bug.cgi?id=464963

--- CGI-SpeedyCGI-2.22/src/speedy_file.c			2003-10-07 06:03:48.000000000 +0200
+++ CGI-SpeedyCGI-2.22/src/speedy_file.c.c99_inline		2008-10-11 02:19:49.000000000 +0200
@@ -109,7 +109,7 @@
 
 
 #ifdef SPEEDY_BACKEND
-SPEEDY_INLINE void speedy_file_fd_is_suspect(void) {
+void speedy_file_fd_is_suspect(void) {
     fd_is_suspect = 1;
 }
 
@@ -293,7 +293,7 @@
     }
 }
 
-SPEEDY_INLINE int speedy_file_set_state(int new_state) {
+int speedy_file_set_state(int new_state) {
     int retval = cur_state;
 
     if (new_state != cur_state) {
--- CGI-SpeedyCGI-2.22/src/speedy_file.h			2003-10-07 06:03:48.000000000 +0200
+++ CGI-SpeedyCGI-2.22/src/speedy_file.hc99_inline		2008-10-11 02:19:49.000000000 +0200
@@ -49,8 +49,8 @@
 #define FS_CORRUPT	3	/* Locked, mmaped, non-atomic writes to file */
 
 extern speedy_file_t *speedy_file_maddr;
-SPEEDY_INLINE void speedy_file_fd_is_suspect(void);
+void speedy_file_fd_is_suspect(void);
 int speedy_file_size(void);
-SPEEDY_INLINE int speedy_file_set_state(int new_state);
+int speedy_file_set_state(int new_state);
 void speedy_file_need_reopen(void);
 void speedy_file_fork_child(void);
--- CGI-SpeedyCGI-2.22/src/speedy_inc.h				2008-10-11 02:08:05.000000000 +0200
+++ CGI-SpeedyCGI-2.22/src/speedy_inc.h.c99_inline		2008-10-11 02:28:25.000000000 +0200
@@ -41,12 +41,6 @@
 #   define MAP_FAILED (-1)
 #endif
 
-#ifdef __GNUC__
-#define SPEEDY_INLINE __inline__
-#else
-#define SPEEDY_INLINE
-#endif
-
 #ifdef EWOULDBLOCK
 #   define SP_EWOULDBLOCK(e) ((e) == EWOULDBLOCK)
 #else
--- CGI-SpeedyCGI-2.22/src/speedy_opt.c				2003-10-07 06:03:48.000000000 +0200
+++ CGI-SpeedyCGI-2.22/src/speedy_opt.c.c99_inline		2008-10-11 02:19:49.000000000 +0200
@@ -441,7 +441,7 @@
     return (const char * const *)(strlist_export(&exec_argv) + script_argv_loc);
 }
 
-SPEEDY_INLINE const char *speedy_opt_script_fname(void) {
+const char *speedy_opt_script_fname(void) {
     return strlist_export(&exec_argv)[script_argv_loc];
 }
 
--- CGI-SpeedyCGI-2.22/src/speedy_opt.h				2003-10-07 06:03:48.000000000 +0200
+++ CGI-SpeedyCGI-2.22/src/speedy_opt.h.c99_inline		2008-10-11 02:19:49.000000000 +0200
@@ -44,6 +44,6 @@
 const char * const *speedy_opt_exec_argv(void);
 const char * const *speedy_opt_exec_envp(void);
 const char * const *speedy_opt_orig_argv(void);
-SPEEDY_INLINE const char *speedy_opt_script_fname(void);
+const char *speedy_opt_script_fname(void);
 void speedy_opt_save(void);
 void speedy_opt_restore(void);
--- CGI-SpeedyCGI-2.22/src/speedy_util.c			2008-10-11 02:07:41.000000000 +0200
+++ CGI-SpeedyCGI-2.22/src/speedy_util.c.c99_inline		2008-10-11 02:19:49.000000000 +0200
@@ -55,7 +55,7 @@
 }
 #endif
 
-SPEEDY_INLINE int speedy_util_geteuid(void) {
+int speedy_util_geteuid(void) {
     if (my_euid == -1)
 	my_euid = geteuid();
     return my_euid;
@@ -70,7 +70,7 @@
 }
 #endif
 
-SPEEDY_INLINE int speedy_util_getuid(void) {
+int speedy_util_getuid(void) {
     static int uid = -1;
     if (uid == -1)
 	uid = getuid();
@@ -86,7 +86,7 @@
 }
 #endif
 
-SPEEDY_INLINE int speedy_util_getpid(void) {
+int speedy_util_getpid(void) {
     if (!saved_pid) saved_pid = getpid();
     return saved_pid;
 }
@@ -178,13 +178,13 @@
     return buf;
 }
 
-SPEEDY_INLINE void speedy_util_gettimeofday(struct timeval *tv) {
+void speedy_util_gettimeofday(struct timeval *tv) {
     if (!saved_time.tv_sec)
 	gettimeofday(&saved_time, NULL);
     *tv = saved_time;
 }
 
-SPEEDY_INLINE int speedy_util_time(void) {
+int speedy_util_time(void) {
     struct timeval tv;
     speedy_util_gettimeofday(&tv);
     return tv.tv_sec;
@@ -290,14 +290,14 @@
     return mi;
 }
 
-SPEEDY_INLINE SpeedyDevIno speedy_util_stat_devino(const struct stat *stbuf) {
+SpeedyDevIno speedy_util_stat_devino(const struct stat *stbuf) {
     SpeedyDevIno retval;
     retval.d = stbuf->st_dev;
     retval.i = stbuf->st_ino;
     return retval;
 }
 
-SPEEDY_INLINE int speedy_util_open_stat(const char *path, struct stat *stbuf)
+int speedy_util_open_stat(const char *path, struct stat *stbuf)
 {
     int fd = open(path, O_RDONLY);
     if (fd != -1 && fstat(fd, stbuf) == -1) {
--- CGI-SpeedyCGI-2.22/src/speedy_util.c.strerror		2003-10-07 06:03:48.000000000 +0200
+++ CGI-SpeedyCGI-2.22/src/speedy_util.c.strerror.c99_inline	2008-10-11 02:19:49.000000000 +0200
@@ -55,7 +55,7 @@
 }
 #endif
 
-SPEEDY_INLINE int speedy_util_geteuid(void) {
+int speedy_util_geteuid(void) {
     if (my_euid == -1)
 	my_euid = geteuid();
     return my_euid;
@@ -70,7 +70,7 @@
 }
 #endif
 
-SPEEDY_INLINE int speedy_util_getuid(void) {
+int speedy_util_getuid(void) {
     static int uid = -1;
     if (uid == -1)
 	uid = getuid();
@@ -86,7 +86,7 @@
 }
 #endif
 
-SPEEDY_INLINE int speedy_util_getpid(void) {
+int speedy_util_getpid(void) {
     if (!saved_pid) saved_pid = getpid();
     return saved_pid;
 }
@@ -149,13 +149,13 @@
     return buf;
 }
 
-SPEEDY_INLINE void speedy_util_gettimeofday(struct timeval *tv) {
+void speedy_util_gettimeofday(struct timeval *tv) {
     if (!saved_time.tv_sec)
 	gettimeofday(&saved_time, NULL);
     *tv = saved_time;
 }
 
-SPEEDY_INLINE int speedy_util_time(void) {
+int speedy_util_time(void) {
     struct timeval tv;
     speedy_util_gettimeofday(&tv);
     return tv.tv_sec;
@@ -261,14 +261,14 @@
     return mi;
 }
 
-SPEEDY_INLINE SpeedyDevIno speedy_util_stat_devino(const struct stat *stbuf) {
+SpeedyDevIno speedy_util_stat_devino(const struct stat *stbuf) {
     SpeedyDevIno retval;
     retval.d = stbuf->st_dev;
     retval.i = stbuf->st_ino;
     return retval;
 }
 
-SPEEDY_INLINE int speedy_util_open_stat(const char *path, struct stat *stbuf)
+int speedy_util_open_stat(const char *path, struct stat *stbuf)
 {
     int fd = open(path, O_RDONLY);
     if (fd != -1 && fstat(fd, stbuf) == -1) {
--- CGI-SpeedyCGI-2.22/src/speedy_util.h			2003-10-07 06:03:48.000000000 +0200
+++ CGI-SpeedyCGI-2.22/src/speedy_util.h.c99_inline		2008-10-11 02:19:49.000000000 +0200
@@ -35,25 +35,25 @@
 } SpeedyBuf;
 
 int speedy_util_pref_fd(int oldfd, int newfd);
-SPEEDY_INLINE int speedy_util_getuid(void);
-SPEEDY_INLINE int speedy_util_geteuid(void);
+int speedy_util_getuid(void);
+int speedy_util_geteuid(void);
 int speedy_util_seteuid(int id);
 int speedy_util_argc(const char * const * argv);
-SPEEDY_INLINE int speedy_util_getpid(void);
+int speedy_util_getpid(void);
 void speedy_util_pid_invalidate(void);
 void speedy_util_die(const char *fmt, ...);
 void speedy_util_die_quiet(const char *fmt, ...);
 int speedy_util_execvp(const char *filename, const char *const *argv);
 char *speedy_util_strndup(const char *s, int len);
-SPEEDY_INLINE int speedy_util_time(void);
-SPEEDY_INLINE void speedy_util_gettimeofday(struct timeval *tv);
+int speedy_util_time(void);
+void speedy_util_gettimeofday(struct timeval *tv);
 void speedy_util_time_invalidate(void);
 char *speedy_util_fname(int num, char type);
 char *speedy_util_getcwd(void);
 SpeedyMapInfo *speedy_util_mapin(int fd, int max_size, int file_size);
 void speedy_util_mapout(SpeedyMapInfo *mi);
-SPEEDY_INLINE SpeedyDevIno speedy_util_stat_devino(const struct stat *stbuf);
-SPEEDY_INLINE int speedy_util_open_stat(const char *path, struct stat *stbuf);
+SpeedyDevIno speedy_util_stat_devino(const struct stat *stbuf);
+int speedy_util_open_stat(const char *path, struct stat *stbuf);
 void speedy_util_exit(int status, int underbar_exit);
 int speedy_util_kill(pid_t pid, int sig);
 


Index: perl-CGI-SpeedyCGI.spec
===================================================================
RCS file: /cvs/pkgs/rpms/perl-CGI-SpeedyCGI/F-9/perl-CGI-SpeedyCGI.spec,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- perl-CGI-SpeedyCGI.spec	4 May 2008 19:39:34 -0000	1.2
+++ perl-CGI-SpeedyCGI.spec	12 Oct 2008 21:00:51 -0000	1.3
@@ -3,7 +3,7 @@
 Summary:        Speed up perl scripts by running them persistently
 Name:           perl-CGI-SpeedyCGI
 Version:        2.22
-Release:        2%{?dist}
+Release:        3%{?dist}
 License:        GPLv3+
 Group:          Development/Libraries
 URL:            http://search.cpan.org/dist/%{pkgname}/
@@ -15,6 +15,7 @@
 Patch3:		perl-CGI-SpeedyCGI-2.22-brigade_foreach.patch
 Patch4:		perl-CGI-SpeedyCGI-2.22-exit_messages.patch
 Patch5:		perl-CGI-SpeedyCGI-2.22-perl_510.patch
+Patch6:		perl-CGI-SpeedyCGI-2.22-c99_inline.patch
 Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
 BuildRequires:  perl >= 5.8.0, perl(ExtUtils::MakeMaker), perl(ExtUtils::Embed)
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -46,6 +47,7 @@
 %patch3 -p1 -b .brigade_foreach
 %patch4 -p1 -b .exit_messages
 %patch5 -p1 -b .perl_510
+%patch6 -p1 -b .c99_inline
 
 %build
 sed -i 's at apxs -@%{_sbindir}/apxs - at g' Makefile.PL src/SpeedyMake.pl \
@@ -82,6 +84,10 @@
 %config(noreplace) %{_sysconfdir}/httpd/conf.d/speedycgi.conf
 
 %changelog
+* Sun Oct 12 2008 Robert Scheck <robert at fedoraproject.org> 2.22-3
+- Work around C99 inline issues caused by C99 inline support in
+  newer GCC versions (#464963, thanks to Andreas Thienemann)
+
 * Sun May 04 2008 Robert Scheck <robert at fedoraproject.org> 2.22-2
 - Changes to match with Fedora Packaging Guidelines (#429609)
 




More information about the fedora-extras-commits mailing list