From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-xb2a.google.com (mail-yb1-xb2a.google.com [IPv6:2607:f8b0:4864:20::b2a]) by sourceware.org (Postfix) with ESMTPS id 087DA3858CD1 for ; Tue, 9 Apr 2024 02:50:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 087DA3858CD1 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 087DA3858CD1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::b2a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712631006; cv=none; b=Ddyfda7xnAU/3TbWEXArm0AuXeAI1Ivi9Y4moAS75urt8JYEyF6RsIzrQ2qQ2h1U1Gl3qezufIGUJo/gFf7EJz5yMulUuIpKkmMarbcIWdc7bQWDl3SST86dPwPVgrKVXD4ohiUXOHSJP30k7bwAWoKUmSY8OeYkvgK/ZxfyB+s= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712631006; c=relaxed/simple; bh=/6E1dpe9fmIvEF6rP+KC/K5LaLLTEWW+za8p446IjZE=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=tEJwZs93xGcuU4xbK5Q8HGXvPtaGzlLVeG4iqdR3m6ETT7/bz+rylTFl0KpWfriyks6tAQBEKxB2mQAH8LGjB9hi98aIkF8V1PuCULgp3mnPlBeVnYPOwOMorygcH0XJiOU6DkfvR05i4PXv1YDfA9PAIvJ3bUY003eCYEavafw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-yb1-xb2a.google.com with SMTP id 3f1490d57ef6-de0f9a501d6so1674447276.3 for ; Mon, 08 Apr 2024 19:50:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712631003; x=1713235803; darn=sourceware.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Z8yvSE1DCH3tTOrEkSTAnHi5qRvOQDQGvyYvwJkXLYM=; b=nES8n7bY2yG+EITTnraXK/haNZ+elYukyJKGLdLckyb3ZrEEJ1O8MtSoHx4+tJY3g7 h6zGTiYeO+j74emo8O2zpyeZ12lRZbMeYubMS1HWT48NLHhW1WwfNhhnpFukc24034RU ZSHnjHEcSthyaDjbeLhAclagFWwpH7EBXjsjNhpZkWBQqzHPMvSwrsaIYgxSlBu3JTX9 6f8EMEolYi7t8Kw+EJVgts87XnkF87Ld4yABAhzsgV1eW0ZzRnfLdbsh2GtCCP42vaz4 CAFkfwY7lOVtecc7I2oPgKzMo44uF5Ws4q4I3cH669nNrx7a0yuE3LKQ2Qpl+Z7FK3D5 oQPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712631003; x=1713235803; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Z8yvSE1DCH3tTOrEkSTAnHi5qRvOQDQGvyYvwJkXLYM=; b=qtug3x2Cg2MbcsZXarW4pzRMmiUxJGWBoaV/8c86n2l5Q9YRVDH4BmUj1eB/hXLx7h i/OGP4BNSnx8dS4O88M0rI+SGq8A1YDazNMrucKyLl8Nv6vEkzeJJS9uqhGUQFGcveJR g5DJv5rORkP78SjZvDywoOs1lH4QqrVJsmsUyqBXPHQKnemnzHdzcZ3BUT5tpIEqdHSW gNCA2iEF/AeAToQ5O9069jG+2btXFXfNzRrM87dbjf5F3tV7E3SQ9Mrqu5KVTXO3M5h7 wDbAQaIB7Vnc2mV+yTLF+qZEm/evWoPcH6cSP1lBkyAEPqE69iH8EODzvXm/D55bVrtP T46w== X-Forwarded-Encrypted: i=1; AJvYcCVW3Dv/yx9alFGNNBKWyKSuzyRSmNNMHmP1sIG0FDvXpky6AER3Ackziqk1xCvoMXKT18h3i6piLjlX9XR6wR1bGk3IKPzU/A== X-Gm-Message-State: AOJu0Ywf0SM6IbgeDFwNQ3GiM6aUm8NJvFsrliuKFglFJuYj33Iu1pvw R1Ka0YiP63Hwe0374Aq+cbyKDvHxjYzPJdmAByp4GsV1KymVGe7JaS43YjlgwsOYOyi6ZwLrHNt A0knu0f6aWtpVSASp0vMrn5Onv6c= X-Google-Smtp-Source: AGHT+IENT4kMuhtYNyKkr7T+Xartddf0NmrCLBu9ldvv78z8FCXFzDfch0vK1ir5VFWxqlrDmzVM+kzNQfjq4MNBFQE= X-Received: by 2002:a25:d001:0:b0:de0:d7dc:8dcf with SMTP id h1-20020a25d001000000b00de0d7dc8dcfmr7281681ybg.56.1712631003185; Mon, 08 Apr 2024 19:50:03 -0700 (PDT) MIME-Version: 1.0 References: <20240317121912.799372-1-hjl.tools@gmail.com> <20240317121912.799372-2-hjl.tools@gmail.com> <6665080c-42e3-4fd7-a843-460de7cef778@polymtl.ca> In-Reply-To: From: "H.J. Lu" Date: Mon, 8 Apr 2024 19:49:26 -0700 Message-ID: Subject: Re: [PATCH] bfd: Define pagesize variables only for mmap To: Alan Modra Cc: Simon Marchi , Binutils , Noah Goldstein , Sam James Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3013.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Mon, Apr 8, 2024 at 3:55=E2=80=AFPM Alan Modra wrote: > > On Mon, Apr 08, 2024 at 07:26:37AM -0700, H.J. Lu wrote: > > On Sun, Apr 7, 2024 at 8:58=E2=80=AFPM Simon Marchi wrote: > > > Since this commit, when building for --host=3Dx86_64-w64-mingw32, I g= et: > > > > > > > > > make[4]: Entering directory '/home/simark/build/binutils-gdb-x86_64-w= 64-mingw32/bfd' > > > CC libbfd.lo > > > /home/simark/src/binutils-gdb/bfd/libbfd.c: In function =E2=80=98bfd_= init_pagesize=E2=80=99: > > > /home/simark/src/binutils-gdb/bfd/libbfd.c:1583:19: error: implicit d= eclaration of function =E2=80=98getpagesize=E2=80=99 [-Werror=3Dimplicit-fu= nction-declaration] > > > 1583 | _bfd_pagesize =3D getpagesize (); > > > | ^~~~~~~~~~~ > > > > > > Simon > > > > Please try this patch. > > You need to revert the change to lynx-core.c as well. The v2 patch is at https://sourceware.org/pipermail/binutils/2024-April/133466.html > Somewhat related, why does binutils/elfedit.c depend on HAVE_MMAP? It uses mmap to update the ELF program header directly. > I run into failures with asan builds (ie. -fsanitize=3Daddress,undefined > in CFLAGS and CXXFLAGS passed to configure). > elfedit: unrecognized option '--enable-x86-feature' I built binutils with GCC 13 using CC=3D"gcc -fsanitize=3Daddress,undefined" CXX=3D"g++ -fsanitize=3Daddress,undefined" /export/gnu/import/git/gitlab/x86-binutils/configure \ --disable-werror --disable-gprofng \ \ --enable-plugins --disable-gdb --disable-gdbserver --disable-libbacktrace --disable-libdecnumber --disable-readline --disable-sim --enable-mark-plt --with-sysroot=3D/ --with-system-zlib \ --prefix=3D/usr/local \ --with-local-prefix=3D/usr/local elfedit works: [hjl@gnu-cfl-3 binutils]$ ./elfedit --enable-x86-feature ibt xx [hjl@gnu-cfl-3 binutils]$ > Apparently HAVE_MMAP configury fusses too much, see this comment: > gnulib/import/m4/mmap-anon.m4: # Check for mmap(). Don't use AC_FUNC_MMA= P, because it checks too much: it It checks MAP_ANONYMOUS, not mmap: # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: i= t # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is # irrelevant for anonymous mappings. --=20 H.J.