public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
To: Matthias Klose <doko@debian.org>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [patch] fix libsanitizer build with -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 on 32bit architectures
Date: Thu, 22 Feb 2024 21:29:18 +0100	[thread overview]
Message-ID: <yddo7c8xmxt.fsf@CeBiTec.Uni-Bielefeld.DE> (raw)
In-Reply-To: <b56ef43a-4e02-4503-b775-ec67ddfea616@debian.org> (Matthias Klose's message of "Thu, 22 Feb 2024 20:48:43 +0100")

Hi Matthias,

> libsanitizer fails to build with -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64,
> triggering an #error in /usr/include/features-time64.h
>
> --- a/libsanitizer/sanitizer_common/sanitizer_procmaps_solaris.cpp
> +++ b/libsanitizer/sanitizer_common/sanitizer_procmaps_solaris.cpp
> @@ -11,6 +11,7 @@
>
>  // Before Solaris 11.4, <procfs.h> doesn't work in a largefile
>  environment.
>  #undef _FILE_OFFSET_BITS
> +#undef _TIME_BITS
>  #include "sanitizer_platform.h"
>  #if SANITIZER_SOLARIS
>  #  include <fcntl.h>
> --- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
> +++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
> @@ -18,6 +18,7 @@
>  // depends on _FILE_OFFSET_BITS setting.
>  // To get this "true" dirent definition, we undefine _FILE_OFFSET_BITS
>  below.
>  #undef _FILE_OFFSET_BITS
> +#undef _TIME_BITS
>  #endif
>
>  // Must go after undef _FILE_OFFSET_BITS.
>
>
> The patch to sanitizer_platform_limits_posix.cpp is already present in
> trunk, but missing from the branches.
>
> Because all platform files are built in GCC, you also see the failure in
> sanitizer_procmaps_solaris.cpp. Just doing the same as for the posix 
> files fixes the issue and libsanitizer builds again.
>
> Does this have any effect on the solaris builds?  If not, ok for the trunk
> and the branches?

Since _TIME_BITS isn't used in Solaris system headers at all, there's no
impact.

However, the sanitizer_procmaps_solaris.cpp change needs to go into
upstream LLVM first and can only then be cherry-picked into libsanitizer
once it has been committed there.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

      reply	other threads:[~2024-02-22 20:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-22 19:48 Matthias Klose
2024-02-22 20:29 ` Rainer Orth [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yddo7c8xmxt.fsf@CeBiTec.Uni-Bielefeld.DE \
    --to=ro@cebitec.uni-bielefeld.de \
    --cc=doko@debian.org \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).