Message ID | 20190716180420.236506-2-nick.alcock@oracle.com |
---|---|
State | Superseded |
Headers | show
Delivered-To: patches-gcc@linaro.org Received: by 2002:a2e:1547:0:0:0:0:0 with SMTP id 7csp1304962ljv; Tue, 16 Jul 2019 11:04:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqwfnHkhrAav21ujehtqQ7JddU2MMvZnp6IUlDlnT2TFrHPK4HaAXxmvgJPuNUlilfreqd7F X-Received: by 2002:a17:902:a612:: with SMTP id u18mr36384589plq.181.1563300279344; Tue, 16 Jul 2019 11:04:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563300279; cv=none; d=google.com; s=arc-20160816; b=AS0S6dFEBqEcwRVrptgXdYHdsGAdsra9zw+pdNYuo8clXbXBZSCJLwyTqpSDI7Zf09 YcuHAMCZiuM7raKfyt0w7OoyTYieKQiwbIq5mERr7o+cjBBblxrNg+Gm/CTe31x48Hko RyLYBsLTVXAKG/hnCJ5gMHDRo/3K/So15pyi2k2x4W9xQBZVX2Lpzzlr3NRRFXIspgTa nmwVbCnbLDUE9ojnDN5YJIiFJ85vi8w/WLvMF8nrs/tXsgh+Sit0xmgZ/jXooFELehFS QOIgBWPDSg8vFUN2556h8JyYVM2cbHu/CiY4skBlsIH7nZ2qOgeljluoifZwohxMtUT7 2SNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:delivered-to :sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=WMN2evojAeuCQR2DuyNf930TCXC5orgD/SXQStDHYD0=; b=MkllnUVdzk6vw9EByO99nX1KaFb8NinL2OZH7Jbvei2YfdsfrUQEtT4SYtgdIjAfp5 5bPGI7cbq1JbCT5NWRfLLQUTFHR/OgQDVb0isCdrMfpzKovaVKsejxhKA+nbtK9aKb1W v2tBTFfdoBz5hbPuzfoXO3m0jBLltwi8dnpMkS7aHpdQ5tlsk5pfWaSykDadGvcFWEPL viZhmcoWYvpGOUzR0QQrP+iQGCQLhr7uAI7Pql0tQWy/iK1wC8BPfTG2RtlM3VndrNHK nFTEGpJ/vjUb8oG9XC7met1CzG8IC3yU7ffE7qnPfW9puDLNNDoBMfjB8P3Gg7TXDmXf iF5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=BYdIMb5c; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=4YATqNkk; spf=pass (google.com: domain of binutils-return-106348-patches-gcc=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="binutils-return-106348-patches-gcc=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: <binutils-return-106348-patches-gcc=linaro.org@sourceware.org> Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id k63si20298185pgk.39.2019.07.16.11.04.38 for <patches-gcc@linaro.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jul 2019 11:04:39 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-return-106348-patches-gcc=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=BYdIMb5c; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=4YATqNkk; spf=pass (google.com: domain of binutils-return-106348-patches-gcc=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="binutils-return-106348-patches-gcc=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; q=dns; s= default; b=VvfDTicAFsYXHVD/TCjibCLriWSKrbCeEWx6+MWM9Q+fIEfnrBoYv 7LqYprWh2BOIeg+e1xJ+VtMMvIAbmdWfTnnP9EnDbDxoa+OS1ZncX7kRajmiuK0h QO89vnGK3xWEMRgpxcLauefRQDEsT0KkV64eR5JKTh+qeefdkRhl88= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; s=default; bh=MsYVVKSAIPGWu1Bmt7de9gndAgE=; b=BYdIMb5ctaCGXbHnVo3WtjFp3xW8 J8pXspeqKJaMjCrnjjTD6d8l8op/wTinqqjWZGWjQZNyioQ1eRNaRB9dq/3spXB2 UJbrarb6dKWf9Tst+O0EXvwQpY+a5BUlX85MuiIyw8UXJAf1ls0LwCqbuhPo/50I 3vW2NeFM6rNelFQ= Received: (qmail 121253 invoked by alias); 16 Jul 2019 18:04:34 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <binutils.sourceware.org> List-Unsubscribe: <mailto:binutils-unsubscribe-patches-gcc=linaro.org@sourceware.org> List-Subscribe: <mailto:binutils-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/binutils/> List-Post: <mailto:binutils@sourceware.org> List-Help: <mailto:binutils-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: binutils-owner@sourceware.org Delivered-To: mailing list binutils@sourceware.org Received: (qmail 121149 invoked by uid 89); 16 Jul 2019 18:04:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 spammy=H*Ad:D*oracle.com, HContent-Transfer-Encoding:8bit X-HELO: aserp2120.oracle.com Received: from aserp2120.oracle.com (HELO aserp2120.oracle.com) (141.146.126.78) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 16 Jul 2019 18:04:33 +0000 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x6GHwvtW188940 for <binutils@sourceware.org>; Tue, 16 Jul 2019 18:04:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=corp-2018-07-02; bh=WMN2evojAeuCQR2DuyNf930TCXC5orgD/SXQStDHYD0=; b=4YATqNkkXbARVkSedXRGFpMYKKjKNxx7ewZPsg8uE5bcwYLJcFjrVEBGFIhs1PQkn2cq QQSdhGQl9/Xl175Q/Xxo14YUDiiaDeKlMTE7UQ0F205pbjRf3aLNhDiTsSh47FNEggr3 JmQfpOE2eD+59ZWCeInXn2DcfJmqh7onPspEQl2CHqf1FQQmtEz1ZGdf0ojG9dotHczM uOs/H61CNrPKT6lED52iaIE21ZPyi8m2MWROrEkddF/daBwCSzMdOlqAkwEZ7fKGo4Vb YFee/qJd2oX0u771P7HHJ5LWoX7ubBnzn3bKuLjryliKFB0kkMRea0U5FhmVWen3zDK4 ZQ== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2120.oracle.com with ESMTP id 2tq78pp3kc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <binutils@sourceware.org>; Tue, 16 Jul 2019 18:04:31 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x6GI2Vu4125196 for <binutils@sourceware.org>; Tue, 16 Jul 2019 18:04:31 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3030.oracle.com with ESMTP id 2tq5bcjat7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <binutils@sourceware.org>; Tue, 16 Jul 2019 18:04:30 +0000 Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x6GI4Tm3025276 for <binutils@sourceware.org>; Tue, 16 Jul 2019 18:04:30 GMT Received: from loom.srvr.nix (/81.187.191.129) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 16 Jul 2019 18:04:29 +0000 From: Nick Alcock <nick.alcock@oracle.com> To: binutils@sourceware.org Cc: elena.zannoni@oracle.com, jose.marchesi@oracle.com, indu.bhagat@oracle.com, egeyar.bagcioglu@oracle.com Subject: [PATCH 01/19] libctf: make it compile for old glibc Date: Tue, 16 Jul 2019 19:04:02 +0100 Message-Id: <20190716180420.236506-2-nick.alcock@oracle.com> In-Reply-To: <20190716180420.236506-1-nick.alcock@oracle.com> References: <20190716180420.236506-1-nick.alcock@oracle.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes |
Series |
|
Related |
show
|
diff --git a/libctf/ctf-endian.h b/libctf/ctf-endian.h index ec177d1bdd..f1cc527a08 100644 --- a/libctf/ctf-endian.h +++ b/libctf/ctf-endian.h @@ -24,10 +24,10 @@ #include <stdint.h> #include "swap.h" -#ifndef HAVE_ENDIAN_H +#if !defined (HAVE_ENDIAN_H) || !defined (htole64) #ifndef WORDS_BIGENDIAN -# define htole64(x) bswap_identity_64 ((x)) -# define le64toh(x) bswap_identity_64 ((x)) +# define htole64(x) (x) +# define le64toh(x) (x) #else # define htole64(x) bswap_64 ((x)) # define le64toh(x) bswap_64 ((x))
From: Hans-Peter Nilsson <hp@bitrange.com> With a glibc before 2.9 (such as 2.8), there's <endian.h> but no htole64 or le64toh, so you get, compiling binutils for any target: libtool: link: gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes \ -Wshadow -Werror -I/x/binutils/../zlib -g -O2 -o objdump \ objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o rdcoff.o \ bucomm.o version.o filemode.o elfcomm.o ../opcodes/.libs/libopcodes.a \ ../libctf/libctf.a ../bfd/.libs/libbfd.a -L/x/obj/b/zlib -lz ../libiberty/libiberty.a -ldl ../libctf/libctf.a(ctf-archive.o): In function `ctf_archive_raw_iter_internal': /x/src/libctf/ctf-archive.c:543: undefined reference to `le64toh' /x/src/libctf/ctf-archive.c:550: undefined reference to `le64toh' /x/src/libctf/ctf-archive.c:551: undefined reference to `le64toh' /x/src/libctf/ctf-archive.c:551: undefined reference to `le64toh' /x/src/libctf/ctf-archive.c:554: undefined reference to `le64toh' ../libctf/libctf.a(ctf-archive.o):/x/src/libctf/ctf-archive.c:545: more undefined references to `le64toh' follow (etc) Also, I see no bswap_identity_64 *anywhere* except in libctf/swap.h (including current glibc) and I don't think calling an "identity"- function is better than just plain "#define foo(x) (x)" anyway. (Where does the idea of a bytestap.h bswap_identity_64 come from?) Speaking of that, I should mention that I instrumented the condition to observe that the WORDS_BIGENDIAN case passes too for a presumed big-endian target and glibc-2.8: there is a bswap_64 present for that version. Curiously, no test-case regressed with that instrumentation. For the record, constructing binary blobs using text source to run tests on, can be done by linking to --oformat binary (with most ELF targets), but I guess that's seen as unnecessary roundabout perhaps checking in binary files in the test-suite would be ok these days. [...] [nca: trimmed commit log slightly, updated changelog] libctf/ * ctf-endian.h: Don't assume htole64 and le64toh are always present if HAVE_ENDIAN_H; also check if htole64 is defined. [! WORDS_BIGENDIAN] (htole64, le64toh): Define as identity, not bswap_identity_64. --- libctf/ctf-endian.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.22.0.238.g049a27acdc