[prev in list] [next in list] [prev in thread] [next in thread]
List: rpm-cvs
Subject: [CVS] RPM: rpm-5_4: rpm/ configure.ac rpm/lib/ misc.c rpmversion.h.in ...
From: "Jeff Johnson" <jbj () rpm5 ! org>
Date: 2014-09-28 19:31:12
Message-ID: 20140928193112.0D37625241 () rpm5 ! org
[Download RAW message or body]
RPM Package Manager, CVS Repository
http://rpm5.org/cvs/
____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson
Root: /v/rpm/cvs Email: jbj@rpm5.org
Module: rpm Date: 28-Sep-2014 21:31:11
Branch: rpm-5_4 Handle: 2014092819310704
Modified files: (Branch: rpm-5_4)
rpm configure.ac
rpm/lib misc.c rpmversion.h.in
rpm/perl Makefile.PL.in
rpm/rpmdb rpmlio.h
rpm/rpmio rpmutil.h set.c
rpm/tests/mongo gridfs.c gridfs.h
Log:
- gcc: resurrect -fpie -pie linkage.
Summary:
Revision Changes Path
2.472.2.119 +25 -17 rpm/configure.ac
2.152.6.3 +1 -1 rpm/lib/misc.c
2.3.6.1 +3 -0 rpm/lib/rpmversion.h.in
1.27.6.3 +3 -1 rpm/perl/Makefile.PL.in
1.2.4.1 +18 -0 rpm/rpmdb/rpmlio.h
1.1.2.2 +22 -0 rpm/rpmio/rpmutil.h
1.1.2.12 +13 -1 rpm/rpmio/set.c
1.1.2.8 +6 -2 rpm/tests/mongo/gridfs.c
1.1.2.2 +12 -6 rpm/tests/mongo/gridfs.h
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: rpm/configure.ac
============================================================================
$ cvs diff -u -r2.472.2.118 -r2.472.2.119 configure.ac
--- rpm/configure.ac 27 Sep 2014 15:59:05 -0000 2.472.2.118
+++ rpm/configure.ac 28 Sep 2014 19:31:07 -0000 2.472.2.119
@@ -126,8 +126,9 @@
AC_ARG_ENABLE(build-pic,
AS_HELP_STRING([--enable-build-pic], [build RPM with Position Independent Code \
(PIC)]), [dnl if test ".$enableval" = .yes; then
- if test ".`$CC --version 2>&1 | grep 'GCC'`" != .; then
- dnl # GNU GCC (usually "gcc")
+ if test \( ".`$CC --version 2>&1 | grep 'GCC'`" != . \) -o \
+ \( ".`$CC --version 2>&1 | grep 'clang'`" != . \); then
+ dnl # GNU GCC (usually "gcc") or LLVM (usually "clang")
CFLAGS="$CFLAGS -fPIC -DPIC"
elif test ".`$CC -V 2>&1 | grep 'Sun C'`" != .; then
dnl # Sun Studio (usually "cc")
@@ -136,24 +137,24 @@
dnl # Intel C/C++ Compiler (usually "icc")
CFLAGS="$CFLAGS -fPIC -DPIC"
else
- AC_MSG_WARN([--enable-build-pic requires GCC, Sun Studio or Intel \
C/C++]) + AC_MSG_WARN([--enable-build-pic requires GCC/clang, Sun Studio \
or Intel C/C++]) fi
fi
])
AC_ARG_ENABLE(build-pie,
- AS_HELP_STRING([--enable-build-pie], [build RPM as Position Independent \
Executable (PIE) (GCC only)]), [dnl + AS_HELP_STRING([--enable-build-pie], [build \
RPM as Position Independent Executable (PIE) (GCC/clang only)]), [dnl if test \
".$enableval" = .yes; then
- if test ".$GCC" = .yes; then
- rpm_CFLAGS_ADD([-fpie], [CFLAGS])
- rpm_LDFLAGS_ADD([-pie], [LDFLAGS])
+ if test \( ".`$CC --version 2>&1 | grep 'GCC'`" != . \) -o \
+ \( ".`$CC --version 2>&1 | grep 'clang'`" != . \); then
+ CFLAGS="$CFLAGS -fpie"
+ LDFLAGS="$LDFLAGS -pie"
else
- AC_MSG_WARN([--enable-build-pie requires GCC])
+ AC_MSG_WARN([--enable-build-pie requires GCC or clang])
fi
fi
])
-CFLAGS="$CFLAGS $RPM_CFLAGS"
+
RPM_CFLAGS=""
-LDFLAGS="$LDFLAGS $RPM_LDFLAGS"
RPM_LDFLAGS=""
AC_ARG_ENABLE(build-warnings,
@@ -173,8 +174,10 @@
rpm_CFLAGS_ADD([-fdiagnostics-show-option],[RPM_CFLAGS])
rpm_CFLAGS_ADD([-Wextra], [RPM_CFLAGS])
+ if test \( ".`$CC --version 2>&1 | grep 'clang'`" != . \); then
rpm_CFLAGS_ADD([-Wdocumentation], [RPM_CFLAGS])
rpm_CFLAGS_ADD([-Wno-documentation-deprecated-sync], [RPM_CFLAGS])
+ fi
dnl # rpm_CFLAGS_ADD([-pedantic], [RPM_CFLAGS])
dnl # rpm_CFLAGS_ADD([-pedantic-errors], [RPM_CFLAGS])
@@ -208,7 +211,7 @@
rpm_CFLAGS_ADD([-Wno-unused-function],[RPM_CFLAGS])
rpm_CFLAGS_ADD([-Wno-unused-parameter], [RPM_CFLAGS])
dnl # XXX not gcc-4.4.7
-dnl rpm_CFLAGS_ADD([-Wunused-result],[RPM_CFLAGS])
+dnl # rpm_CFLAGS_ADD([-Wunused-result],[RPM_CFLAGS])
rpm_CFLAGS_ADD([-Wno-unused-value],[RPM_CFLAGS])
rpm_CFLAGS_ADD([-Wno-unused-variable],[RPM_CFLAGS])
@@ -266,10 +269,13 @@
dnl # rpm_CFLAGS_ADD([-Wmissing-declarations],[RPM_CFLAGS])
dnl # rpm_CFLAGS_ADD([-Wmissing-prototypes],[RPM_CFLAGS])
dnl # rpm_CFLAGS_ADD([-Wold-style-definition],[RPM_CFLAGS])
-# XXX rpmio/set.c needs this
- if test \( ".`$CC --version 2>&1 | grep 'GCC'`" != . \); then
- rpm_CFLAGS_ADD([-Wno-override-init], [RPM_CFLAGS])
- fi
+dnl #XXX rpmio/set.c
+dnl # if test \( ".`$CC --version 2>&1 | grep 'clang'`" != . \); then
+dnl # rpm_CFLAGS_ADD([-Wno-initializer-overrides], [RPM_CFLAGS])
+dnl # fi
+dnl # if test \( ".`$CC --version 2>&1 | grep 'GCC'`" != . \); then
+dnl # rpm_CFLAGS_ADD([-Wno-override-init], [RPM_CFLAGS])
+dnl # fi
dnl # rpm_CFLAGS_ADD([-Wpointer-to-int-cast],[RPM_CFLAGS])
dnl # rpm_CFLAGS_ADD([-Wno-strict-prototypes],[RPM_CFLAGS])
@@ -427,12 +433,14 @@
dnl # --- configure --enable-build-sanitize-memory
rpm_CFLAGS_ADD([-fsanitize=memory -fsanitize-memory-track-origins=2 \
-fno-omit-frame-pointer], [RPM_CFLAGS]) dnl # --- configure \
--enable-build-sanitize-thread
- rpm_CFLAGS_ADD([-fsanitize=thread -fpie], [RPM_CFLAGS])
+ rpm_CFLAGS_ADD([-fsanitize=thread -fpie -pie], [RPM_CFLAGS])
rpm_CFLAGS_ADD([-fsanitize=integer], [RPM_CFLAGS])
rpm_CFLAGS_ADD([-fsanitize=undefined], [RPM_CFLAGS])
rpm_CFLAGS_ADD([-fsanitize=undefined-trap], [RPM_CFLAGS])
+ rpm_CFLAGS_ADD([-fgnu-tm], [RPM_CFLAGS])
+
elif test ".`$CC -V 2>&1 | grep 'Sun C'`" != .; then
dnl # Sun Studio (usually "cc")
CFLAGS="$CFLAGS -v"
@@ -500,7 +508,7 @@
AS_HELP_STRING([--enable-build-sanitize-thread], [build RPM instrumented for \
with ThreadSanitizer]), [dnl if test ".$enableval" = .yes; then
if test \( ".`$CC --version 2>&1 | grep 'GCC'`" != . \); then
- rpm_CFLAGS_ADD([-fsanitize=thread -fpie], [CFLAGS])
+ rpm_CFLAGS_ADD([-fsanitize=thread -fpie -pie], [CFLAGS])
fi
if test \( ".`$CC --version 2>&1 | grep 'clang'`" != . \); then
rpm_CFLAGS_ADD([-fsanitize=thread], [CFLAGS])
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/misc.c
============================================================================
$ cvs diff -u -r2.152.6.2 -r2.152.6.3 misc.c
--- rpm/lib/misc.c 15 Apr 2012 21:20:57 -0000 2.152.6.2
+++ rpm/lib/misc.c 28 Sep 2014 19:31:07 -0000 2.152.6.3
@@ -4,8 +4,8 @@
#include "system.h"
-#include <rpmversion.h>
#include <rpmiotypes.h>
+#include <rpmversion.h>
#include <rpmlog.h>
#include <rpmurl.h>
#include <rpmmacro.h> /* XXX for rpmGetPath */
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/rpmversion.h.in
============================================================================
$ cvs diff -u -r2.3 -r2.3.6.1 rpmversion.h.in
--- rpm/lib/rpmversion.h.in 31 Jul 2008 02:40:06 -0000 2.3
+++ rpm/lib/rpmversion.h.in 28 Sep 2014 19:31:08 -0000 2.3.6.1
@@ -71,10 +71,13 @@
/* link-time information */
extern uint32_t rpmlibVersion(void)
+ RPM_GNUC_CONST
/*@*/;
extern uint32_t rpmlibTimestamp(void)
+ RPM_GNUC_CONST
/*@*/;
extern uint32_t rpmlibVendor(void)
+ RPM_GNUC_CONST
/*@*/;
/* compile-time information */
@@ .
patch -p0 <<'@@ .'
Index: rpm/perl/Makefile.PL.in
============================================================================
$ cvs diff -u -r1.27.6.2 -r1.27.6.3 Makefile.PL.in
--- rpm/perl/Makefile.PL.in 22 Mar 2012 23:45:15 -0000 1.27.6.2
+++ rpm/perl/Makefile.PL.in 28 Sep 2014 19:31:08 -0000 1.27.6.3
@@ -32,7 +32,9 @@
);
# teach MakeMaker some Mac OS X LDFLAGS:
-my @LDFLAGS = qw(@LDFLAGS@ @WITH_PERL_LIBS@ $(CCCDLFLAGS) $(CCDLFLAGS) \
-L$(PERL_ARCHLIB)/CORE -lperl ); +my $xLDFLAGS = q(@LDFLAGS@);
+$xLDFLAGS =~ s/-pie//;
+my @LDFLAGS = qw($(xLDFLAGS) @WITH_PERL_LIBS@ $(CCCDLFLAGS) $(CCDLFLAGS) \
-L$(PERL_ARCHLIB)/CORE -lperl ); my $uname = `uname`; chomp($uname);
foreach (@LDFLAGS) {
if ("$uname" eq "Darwin" && m/^(-arch|ppc|i386|ppc64|x86_64)$/) {
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmdb/rpmlio.h
============================================================================
$ cvs diff -u -r1.2 -r1.2.4.1 rpmlio.h
--- rpm/rpmdb/rpmlio.h 10 Dec 2009 17:08:42 -0000 1.2
+++ rpm/rpmdb/rpmlio.h 28 Sep 2014 19:31:10 -0000 1.2.4.1
@@ -7,62 +7,80 @@
int rpmlioCreat(rpmdb rpmdb, const char * fn, mode_t mode,
const uint8_t * b, size_t blen,
const uint8_t * d, size_t dlen, uint32_t dalgo)
+ RPM_GNUC_CONST
/*@*/;
int rpmlioUnlink(rpmdb rpmdb, const char * fn, mode_t mode,
const uint8_t * b, size_t blen,
const uint8_t * d, size_t dlen, uint32_t dalgo)
+ RPM_GNUC_CONST
/*@*/;
int rpmlioRename(rpmdb rpmdb, const char * oldname, const char * newname,
mode_t mode,
const uint8_t * b, size_t blen,
const uint8_t * d, size_t dlen, uint32_t dalgo)
+ RPM_GNUC_CONST
/*@*/;
int rpmlioMkdir(rpmdb rpmdb, const char * dn, mode_t mode)
+ RPM_GNUC_CONST
/*@*/;
int rpmlioRmdir(rpmdb rpmdb, const char * dn, mode_t mode)
+ RPM_GNUC_CONST
/*@*/;
int rpmlioLsetfilecon(rpmdb rpmdb, const char * fn, const char * context)
+ RPM_GNUC_CONST
/*@*/;
int rpmlioChown(rpmdb rpmdb, const char * fn, uid_t uid, gid_t gid)
+ RPM_GNUC_CONST
/*@*/;
int rpmlioLchown(rpmdb rpmdb, const char * fn, uid_t uid, gid_t gid)
+ RPM_GNUC_CONST
/*@*/;
int rpmlioChmod(rpmdb rpmdb, const char * fn, mode_t mode)
+ RPM_GNUC_CONST
/*@*/;
int rpmlioUtime(rpmdb rpmdb, const char * fn, time_t actime, time_t modtime)
+ RPM_GNUC_CONST
/*@*/;
int rpmlioSymlink(rpmdb rpmdb, const char * ln, const char * fn)
+ RPM_GNUC_CONST
/*@*/;
int rpmlioLink(rpmdb rpmdb, const char * ln, const char * fn)
+ RPM_GNUC_CONST
/*@*/;
int rpmlioMknod(rpmdb rpmdb, const char * fn, mode_t mode, dev_t dev)
+ RPM_GNUC_CONST
/*@*/;
int rpmlioMkfifo(rpmdb rpmdb, const char * fn, mode_t mode)
+ RPM_GNUC_CONST
/*@*/;
int rpmlioPrein(rpmdb rpmdb, const char ** av, const char * body)
+ RPM_GNUC_CONST
/*@*/;
int rpmlioPostin(rpmdb rpmdb, const char ** av, const char * body)
+ RPM_GNUC_CONST
/*@*/;
int rpmlioPreun(rpmdb rpmdb, const char ** av, const char * body)
+ RPM_GNUC_CONST
/*@*/;
int rpmlioPostun(rpmdb rpmdb, const char ** av, const char * body)
+ RPM_GNUC_CONST
/*@*/;
#endif /* H_RPMLIO */
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmio/rpmutil.h
============================================================================
$ cvs diff -u -r1.1.2.1 -r1.1.2.2 rpmutil.h
--- rpm/rpmio/rpmutil.h 27 Sep 2014 15:51:24 -0000 1.1.2.1
+++ rpm/rpmio/rpmutil.h 28 Sep 2014 19:31:11 -0000 1.1.2.2
@@ -105,6 +105,28 @@
# define RPM_GNUC_INTERNAL
#endif
+#if !__clang__ && __GNUC__ == 4 && __GNUC_MINOR__ >= 7 /* XXX gud enuf? */
+# define RPM_GNUC_STM_SAFE __attribute__((transaction_safe))
+# define RPM_GNUC_STM_PURE __attribute__((transaction_pure))
+# define RPM_GNUC_STM_CALLABLE __attribute__((transaction_callable))
+# define RPM_GNUC_STM_UNSAFE __attribute__((transaction_unsafe))
+# define RPM_GNUC_STM_MAYCANCEL __attribute__((transaction_may_cancel_outer))
+# define RPM_GNUC_STM_WRAP(func) __attribute__((transaction_wrap(func)))
+# define RPM_GNUC_STM_ATOMIC __transaction_atomic
+# define RPM_GNUC_STM_RELAXED __transaction_relaxed
+# define RPM_GNUC_STM_CANCEL __transaction_cancel /* XXX [[outer]] */
+#else
+# define RPM_GNUC_STM_SAFE
+# define RPM_GNUC_STM_PURE
+# define RPM_GNUC_STM_CALLABLE
+# define RPM_GNUC_STM_UNSAFE
+# define RPM_GNUC_STM_MAYCANCEL
+# define RPM_GNUC_STM_WRAP(func)
+# define RPM_GNUC_STM_ATOMIC
+# define RPM_GNUC_STM_RELAXED
+# define RPM_GNUC_STM_CANCEL
+#endif
+
/* Guard C code in headers, while including them from C++ */
#ifdef __cplusplus
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmio/set.c
============================================================================
$ cvs diff -u -r1.1.2.11 -r1.1.2.12 set.c
--- rpm/rpmio/set.c 24 Sep 2014 13:03:04 -0000 1.1.2.11
+++ rpm/rpmio/set.c 28 Sep 2014 19:31:11 -0000 1.1.2.12
@@ -125,6 +125,9 @@
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winitializer-overrides"
+#else
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Woverride-init"
#endif
/* This table maps alnum characters to their numeric values. */
@@ -144,6 +147,8 @@
#ifdef __clang__
#pragma clang diagnostic pop
+#else
+#pragma GCC diagnostic pop
#endif
static inline
@@ -461,6 +466,9 @@
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winitializer-overrides"
+#else
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Woverride-init"
#endif
/* Maps base62 word into numeric value (decoded bits) ORed with word type. */
@@ -546,6 +554,8 @@
#ifdef __clang__
#pragma clang diagnostic pop
+#else
+#pragma GCC diagnostic pop
#endif
/* Combined base62+golomb decoding routine. */
@@ -1361,8 +1371,8 @@
}
/* Jenkins' one-at-a-time hash */
- RPM_GNUC_PURE
static
+ RPM_GNUC_PURE
unsigned int hash(const char *str)
{
unsigned int hash = 0x9e3779b9;
@@ -1380,6 +1390,7 @@
/* sort by hash value */
static
+ RPM_GNUC_PURE
int cmp(const void *arg1, const void *arg2)
{
struct sv *sv1 = (struct sv *) arg1;
@@ -1392,6 +1403,7 @@
}
static
+ RPM_GNUC_PURE
int uniqv(int c, unsigned *v)
{
int i, j;
@@ .
patch -p0 <<'@@ .'
Index: rpm/tests/mongo/gridfs.c
============================================================================
$ cvs diff -u -r1.1.2.7 -r1.1.2.8 gridfs.c
--- rpm/tests/mongo/gridfs.c 23 Sep 2014 18:29:10 -0000 1.1.2.7
+++ rpm/tests/mongo/gridfs.c 28 Sep 2014 19:31:11 -0000 1.1.2.8
@@ -177,6 +177,7 @@
fill_buffer_randomly( data_before, UPPER );
for ( i = LOWER; i <= UPPER; i += DELTA ) {
+ size_t nw;
/* Input from buffer */
gridfs_store_buffer( gfs, data_before, i, "input-buffer", "text/html", \
GRIDFILE_COMPRESS ); @@ -184,7 +185,8 @@
/* Input from file */
fd = fopen( "input-file", "w" );
- fwrite( data_before, sizeof( char ), (size_t)i, fd );
+ nw = fwrite( data_before, sizeof( char ), (size_t)i, fd );
+ASSERT(nw == (size_t)i);
fclose( fd );
gridfs_store_file( gfs, "input-file", "input-file", "text/html", \
GRIDFILE_DEFAULT );
test_gridfile( gfs, data_before, i, "input-file", "text/html" );
@@ -310,6 +312,7 @@
int64_t j = i / 2 - 3;
gridfs_offset bytes_to_write_first;
int n;
+ size_t nw;
/* Input from buffer */
gridfs_store_buffer( gfs, data_before, i, "input-buffer", "text/html", \
GRIDFILE_DEFAULT ); @@ -342,7 +345,8 @@
/* Input from file */
fd = fopen( "input-file", "w" );
- fwrite( data_before, sizeof( char ), (size_t) (j + n > i ? j + n : i), fd \
); + nw = fwrite( data_before, sizeof( char ), (size_t) (j + n > i ? j + n : \
i), fd ); +ASSERT(nw == (size_t) (j + n > i ? j + n : i));
fclose( fd );
gridfs_store_file( gfs, "input-file", "input-file", "text/html", \
GRIDFILE_DEFAULT );
test_gridfile( gfs, data_before, j + n > i ? j + n : i, "input-file", \
"text/html" ); @@ .
patch -p0 <<'@@ .'
Index: rpm/tests/mongo/gridfs.h
============================================================================
$ cvs diff -u -r1.1.2.1 -r1.1.2.2 gridfs.h
--- rpm/tests/mongo/gridfs.h 9 Jul 2013 12:06:14 -0000 1.1.2.1
+++ rpm/tests/mongo/gridfs.h 28 Sep 2014 19:31:11 -0000 1.1.2.2
@@ -116,7 +116,7 @@
/**
* Destroys the GridFile
*
- * @param oGridFIle - the GridFile being destroyed
+ * @param gfile - the GridFile being destroyed
*/
MONGO_EXPORT void gridfile_destroy( gridfile *gfile );
@@ -127,6 +127,13 @@
* +-+-+-+- This modified version of GridFS allows the file to read/write \
randomly
* +-+-+-+- when using this function
*
+ * @param gfile - the GridFile
+ * @param gfs - the working GridFS
+ * @param remote_name - filename for use in the database
+ * @param content_type - optional MIME type for this object
+ * @param flags - flags
+ *
+ * @return - MONGO_OK or MONGO_ERROR.
*/
MONGO_EXPORT int gridfile_writer_init( gridfile *gfile, gridfs *gfs, const char \
*remote_name,
const char *content_type, int flags );
@@ -294,7 +301,7 @@
/**
* Returns the caseInsensitive flag value of gfs
- * @param gfile - the working GridFile
+ * @param gfs - the working gfs
*
* @return - the caseInsensitive flag of the gfs
*/
@@ -305,7 +312,6 @@
* @param gfs - the working gfs
* @param newValue - the new value for the caseInsensitive flag of gfs
*
- * @return - void
*/
MONGO_EXPORT void gridfs_set_caseInsensitive(gridfs *gfs, bson_bool_t newValue);
@@ -314,7 +320,6 @@
* @param gfile - the working GridFile
* @param flags - the value of the flags to set on the provided GridFile
*
- * @return - void
*/
MONGO_EXPORT void gridfile_set_flags(gridfile *gfile, int flags);
@@ -322,7 +327,7 @@
* gets the flags of the GridFile
* @param gfile - the working GridFile
*
- * @return - void
+ * @return - flags
*/
MONGO_EXPORT int gridfile_get_flags( const gridfile *gfile );
@@ -364,8 +369,9 @@
/**
* Returns chunk n of GridFile
* @param gfile - the working GridFile
+ * @param n - the chunk index
+ * @retval out - *out the chunk
*
- * @return - the nth chunk of the Gridfile
*/
MONGO_EXPORT void gridfile_get_chunk( gridfile *gfile, int n, bson* out );
@@ .
______________________________________________________________________
RPM Package Manager http://rpm5.org
CVS Sources Repository rpm-cvs@rpm5.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic