Index: head/devel/elfutils/Makefile =================================================================== --- head/devel/elfutils/Makefile (revision 484411) +++ head/devel/elfutils/Makefile (revision 484412) @@ -1,55 +1,58 @@ # Created by: Conrad Meyer # $FreeBSD$ PORTNAME= elfutils PORTVERSION= 0.174 +PORTREVISION= 1 CATEGORIES= devel MASTER_SITES= https://sourceware.org/elfutils/ftp/${PORTVERSION}/ MAINTAINER= cem@FreeBSD.org COMMENT= Library for manipulating ELF files and partial implementation of binutils LICENSE= LGPL3 GPLv2+ GPLv3+ LICENSE_COMB= multi LICENSE_FILE_GPLv3+ = ${WRKSRC}/COPYING LICENSE_FILE_GPLv2+ = ${WRKSRC}/COPYING-GPLV2 LICENSE_FILE_LGPL3= ${WRKSRC}/COPYING-LGPLV3 BROKEN_aarch64= fails to build: fatal error: linux/uio.h: No such file or directory BROKEN_armv6= fails to build: fails to compile i386_disasm.c BROKEN_armv7= fails to build: fails to compile i386_disasm.c BROKEN_sparc64= sparc patch does not apply cleanly to 0.172 LIB_DEPENDS= libargp.so:devel/argp-standalone PATCH_DEPENDS= ${NONEXISTENT}:devel/gnulib:extract PLIST_SUB= VERSION=${PORTVERSION} OPTIONS_DEFINE= NLS OPTIONS_SUB= yes NLS_USES= gettext NLS_USES_OFF= gettext # used anyway NLS_CONFIGURE_ENABLE= nls USES= autoreconf gmake libtool tar:bzip2 -USE_GCC= 7 +USE_GCC= yes GNU_CONFIGURE= yes USE_LDCONFIG= yes CFLAGS+= -Wno-null-dereference -Wno-unused-value +# For GCC8: +CFLAGS+= -Wno-cast-function-type # Give i386 a prayer of building, and we can fix the warnings later: CFLAGS_i386+= -Wno-error # Avoid conflict with binutils / elftoolchain programs with the same names: CONFIGURE_ARGS+= --program-prefix=eu- post-patch: @${LN} -s `${MAKE} -C ${PORTSDIR}/devel/gnulib -V WRKSRC` ${WRKDIR}/gnulib @${CP} -a \ ${WRKDIR}/gnulib/lib/obstack.c \ ${WRKDIR}/gnulib/lib/obstack.h \ ${WRKDIR}/gnulib/lib/obstack_printf.c \ ${WRKSRC}/lib .include Index: head/devel/elfutils/files/patch-lib_eu-config.h =================================================================== --- head/devel/elfutils/files/patch-lib_eu-config.h (revision 484411) +++ head/devel/elfutils/files/patch-lib_eu-config.h (revision 484412) @@ -1,173 +1,174 @@ --- lib/eu-config.h.orig 2015-06-11 11:38:55 UTC +++ lib/eu-config.h -@@ -187,4 +187,170 @@ asm (".section predict_data, \"aw\"; .pr +@@ -187,4 +187,171 @@ asm (".section predict_data, \"aw\"; .pr #endif +/* FreeBSD ports of glibcisms */ +#include +#include ++#include +#include +#include +#include +#include +#include + +#define _GL_ATTRIBUTE_PURE __attribute__((__pure__)) + +struct obstack; +extern int obstack_printf(struct obstack *, const char *, ...); +extern int obstack_vprintf(struct obstack *, const char *, va_list); + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" +static inline void * +mempcpy(void * restrict dst, const void * restrict src, size_t len) +{ + + return (((char *)memcpy(dst, src, len)) + len); +} + +static inline wchar_t * +wmempcpy(wchar_t * restrict dst, const wchar_t * restrict src, size_t len) +{ + + return (wmemcpy(dst, src, len) + len); +} +#pragma GCC diagnostic pop + +static inline void * +rawmemchr(const void *s, int c) +{ + -+ return (memchr(s, c, SIZE_MAX)); ++ return (memchr(s, c, SSIZE_MAX)); +} + +static inline void +tdestroy(void *vroot __unused, void (*freefct)(void *) __unused) +{ + + /* XXX: Just leak the memory for now. */ +} + +static inline char * +canonicalize_file_name(const char *path) +{ + + return (realpath(path, NULL)); +} + +/* + * A GNU-like basename(). + * + * Unlike POSIX basename(3), this version never modifies its argument. If the + * argument ends in a slash, it returns the empty string. + */ +static inline char * +eu_basename(const char *path) +{ + const char *slash; + + slash = strrchr(path, '/'); + if (slash != NULL) + slash++; + else + slash = path; + return (__DECONST(char *, slash)); +} +#ifdef basename +#undef basename +#endif +#define basename eu_basename + +#ifndef TEMP_FAILURE_RETRY +#define TEMP_FAILURE_RETRY(expr) ({ \ + long value; \ + do { \ + value = (long)(expr); \ + } while (value == -1 && errno == EINTR); \ + (value); \ +}) +#endif + +#define strndupa(s, n) \ +({ \ + size_t len = (n); \ + const char *end; \ + char *res; \ + \ + end = memchr((s), 0, (n)); \ + if (end != NULL) \ + len = end - (s); \ + \ + res = alloca(len + 1); \ + memcpy(res, (s), len); \ + res[len] = '\0'; \ + res; \ +}) + + +#define program_invocation_short_name __DECONST(char *, getprogname()) +#ifndef loff_t +#define loff_t off_t +#endif +#ifndef off64_t +#define off64_t off_t +#endif + +#define ftruncate64 ftruncate +#define open64 open +#define fstat64 fstat +#define stat64 stat +#define pread64 pread +#define mmap64 mmap +#define lseek64 lseek + +#define MAP_POPULATE MAP_PREFAULT_READ + +#define bswap_16 bswap16 +#define bswap_32 bswap32 +#define bswap_64 bswap64 + +#define fputc_unlocked putc_unlocked +#define fputs_unlocked fputs +#define fwrite_unlocked fwrite +#define fread_unlocked fread + +#ifndef __BYTE_ORDER +#define __BYTE_ORDER _BYTE_ORDER +#endif +#ifndef __LITTLE_ENDIAN +#define __LITTLE_ENDIAN _LITTLE_ENDIAN +#endif +#ifndef __BIG_ENDIAN +#define __BIG_ENDIAN _BIG_ENDIAN +#endif + +#define DL_CALL_FCT(fn, args) ((fn) args) + +/* This package doesn't really respect --disable-nls. Hack it. */ +#if !ENABLE_NLS +/* Skip loading libintl.h, which is hardcoded in most source files: */ +#define _LIBINTL_H 1 +#define dgettext(module, str) (str) +#define gettext(str) (str) + +static inline char * +bindtextdomain(const char *d __unused, const char *dr __unused) +{ + + return ("/"); +} + +static inline char * +textdomain(const char *dom) +{ + + return (__DECONST(char *, dom)); +} + +#define ngettext(s, p, n) (((n) == 1) ? (s) : (p)) +#endif + #endif /* eu-config.h */