From owner-svn-src-all@freebsd.org Wed May 20 21:41:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA45A2F652F; Wed, 20 May 2020 21:41:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S5md4j0hz3bmt; Wed, 20 May 2020 21:41:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 833FA2296C; Wed, 20 May 2020 21:41:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KLfbci003565; Wed, 20 May 2020 21:41:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KLfbP6003562; Wed, 20 May 2020 21:41:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005202141.04KLfbP6003562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 20 May 2020 21:41:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r361301 - in stable/12: contrib/elftoolchain/common contrib/elftoolchain/libelftc lib/libelf X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable/12: contrib/elftoolchain/common contrib/elftoolchain/libelftc lib/libelf X-SVN-Commit-Revision: 361301 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 21:41:37 -0000 Author: emaste Date: Wed May 20 21:41:36 2020 New Revision: 361301 URL: https://svnweb.freebsd.org/changeset/base/361301 Log: MFC r349577 (arichardson): Allow bootstrapping elftoolchain on MacOS and Linux This is required in order to build on non-FreeBSD systems without setting all the XAR/XSTRINGS/etc. variables Modified: stable/12/contrib/elftoolchain/common/_elftc.h stable/12/contrib/elftoolchain/libelftc/elftc_set_timestamps.c stable/12/lib/libelf/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/elftoolchain/common/_elftc.h ============================================================================== --- stable/12/contrib/elftoolchain/common/_elftc.h Wed May 20 21:39:19 2020 (r361300) +++ stable/12/contrib/elftoolchain/common/_elftc.h Wed May 20 21:41:36 2020 (r361301) @@ -374,11 +374,14 @@ extern const char *__progname; #include #define htobe32(x) OSSwapHostToBigInt32(x) +#define htole32(x) OSSwapHostToLittleInt32(x) +#ifndef roundup2 #define roundup2 roundup +#endif -#define ELFTC_BYTE_ORDER _BYTE_ORDER -#define ELFTC_BYTE_ORDER_LITTLE_ENDIAN _LITTLE_ENDIAN -#define ELFTC_BYTE_ORDER_BIG_ENDIAN _BIG_ENDIAN +#define ELFTC_BYTE_ORDER __DARWIN_BYTE_ORDER +#define ELFTC_BYTE_ORDER_LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN +#define ELFTC_BYTE_ORDER_BIG_ENDIAN __DARWIN_BIG_ENDIAN #define ELFTC_HAVE_MMAP 1 #define ELFTC_HAVE_STRMODE 1 @@ -418,7 +421,9 @@ extern const char *__progname; /* Whether we need to supply {be,le}32dec. */ #define ELFTC_NEED_BYTEORDER_EXTENSIONS 1 +#ifndef roundup2 #define roundup2 roundup +#endif #endif /* __GLIBC__ || __linux__ */ Modified: stable/12/contrib/elftoolchain/libelftc/elftc_set_timestamps.c ============================================================================== --- stable/12/contrib/elftoolchain/libelftc/elftc_set_timestamps.c Wed May 20 21:39:19 2020 (r361300) +++ stable/12/contrib/elftoolchain/libelftc/elftc_set_timestamps.c Wed May 20 21:41:36 2020 (r361301) @@ -37,7 +37,7 @@ ELFTC_VCSID("$Id$"); * stat'. */ -#if defined(__FreeBSD__) || defined(__NetBSD__) +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) #define ATIME st_atimespec #define MTIME st_mtimespec #define LIBELFTC_HAVE_UTIMES 1 Modified: stable/12/lib/libelf/Makefile ============================================================================== --- stable/12/lib/libelf/Makefile Wed May 20 21:39:19 2020 (r361300) +++ stable/12/lib/libelf/Makefile Wed May 20 21:41:36 2020 (r361301) @@ -79,6 +79,13 @@ INCS= libelf.h gelf.h # SRCS+= sys/elf32.h sys/elf64.h sys/elf_common.h +# Allow bootstrapping elftoolchain on Linux: +.if defined(BOOTSTRAPPING) && ${.MAKE.OS} == "Linux" +native-elf-format.h: + ${ELFTCDIR}/common/native-elf-format > ${.TARGET} || rm ${.TARGET} +SRCS+= native-elf-format.h +.endif + GENSRCS= libelf_fsize.c libelf_msize.c libelf_convert.c CLEANFILES= ${GENSRCS} CLEANDIRS= sys