public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "adhemerval.zanella at linaro dot org" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug libc/31927] clang open fortify wrapper does not handle argument correctly
Date: Tue, 25 Jun 2024 14:54:14 +0000	[thread overview]
Message-ID: <bug-31927-131-hqqAQm9WB0@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-31927-131@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=31927

--- Comment #2 from Adhemerval Zanella <adhemerval.zanella at linaro dot org> ---
(In reply to Simon Chopin from comment #1)
> Not sure, but this patch might help with this:
> 
> https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/glibc/tree/debian/
> patches/ubuntu/fix-fortify-source.patch
> 
> I still need to find the time to submit it properly.

The open fortify wrapper is not fully corrected I see the failures being
corrected with the fix:

diff --git a/io/bits/fcntl2.h b/io/bits/fcntl2.h
index 26f1792fd1..c8888b50c1 100644
--- a/io/bits/fcntl2.h
+++ b/io/bits/fcntl2.h
@@ -62,7 +62,7 @@ open (const char *__path, int __oflag, ...)
 }
 #elif __fortify_use_clang
 __fortify_function_error_function __attribute_overloadable__ int
-open (const char *__path, int __oflag, mode_t __mode, ...)
+open (__fortify_clang_overload_arg (const char *, ,__path), int __oflag, ...)
      __fortify_clang_unavailable ("open can be called either with 2 or 3
arguments, not more");

 __fortify_function __attribute_overloadable__ int


This Ubuntu out-of-tree patch is indeed for something different, where one can
not build glibc without adding -U_FORTIFY_SOURCE if the compiler defaults for
-D_FORTIFY_SOURCE.  I am unsure why -Wp was added in the first place since it
bypassed the compiler driver.  

Could you open another bug to track build failure if the compiler defaults to
-D_FORTIFY_SOURCE?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2024-06-25 14:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-25 14:04 [Bug libc/31927] New: " adhemerval.zanella at linaro dot org
2024-06-25 14:48 ` [Bug libc/31927] " simon.chopin at canonical dot com
2024-06-25 14:54 ` adhemerval.zanella at linaro dot org [this message]
2024-06-27 16:35 ` adhemerval.zanella at linaro dot org
2024-06-27 16:36 ` adhemerval.zanella at linaro dot org

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=bug-31927-131-hqqAQm9WB0@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.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).