public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: "McAllister, Colin" <Colin.McAllister@garmin.com>
To: Ulf Hermann <ulf.hermann@qt.io>,
	"elfutils-devel@sourceware.org" <elfutils-devel@sourceware.org>
Subject: Re: Building Elfutils with Mingw32
Date: Fri, 15 Sep 2023 15:42:35 +0000	[thread overview]
Message-ID: <SA2PR04MB7723A3AF47D771A31F8F7ABFF4F6A@SA2PR04MB7723.namprd04.prod.outlook.com> (raw)
In-Reply-To: <df506e81-cfba-a4db-cd90-8e9651dea6c9@qt.io>

[-- Attachment #1: Type: text/plain, Size: 1762 bytes --]

Ulf,

My only other suggestion for avoiding manually specifying O_BINARY and O_TEXT would be to override the open call on Windows and use O_BINARY as the default and switch to O_TEXT on a condition. Maybe that condition could be based on the file signature or some other analysis of the file contents. Probably not the most efficient or deterministic solution, but it's the only alternative I can think of. Specifying O_BINARY and O_TEXT is probably the better option. Gnulib states that O_BINARY and O_TEXT are "essential for portability to native Windows platforms" https://www.gnu.org/software/gnulib/manual/html_node/fcntl_002eh.html

Best,
Colin
________________________________
From: Ulf Hermann <ulf.hermann@qt.io>
Sent: Friday, September 15, 2023 01:57
To: McAllister, Colin <Colin.McAllister@garmin.com>; elfutils-devel@sourceware.org <elfutils-devel@sourceware.org>
Subject: Re: Building Elfutils with Mingw32

CAUTION - EXTERNAL EMAIL: Do not click any links or open any attachments unless you trust the sender and know the content is safe.


Indeed I have noticed the other patches, but I don't think they are the
same as mine. So, now we have a three way merge.

I guess some more of the changes could be merged if properly cleaned up
and made to benefit other obscure platforms, too. However, there are a
few I got a definite "no" for. In particular the windows dance around
text/binary mode when opening files was not welcome. I couldn't come up
with a better solution than adding an O_BINARY or O_TEXT to every single
open() call. We actually need the distinction as some files need to be
opened in text mode for the tests to pass. If you can come up with
anything better here, please let me know.

best regards,
Ulf

  reply	other threads:[~2023-09-15 15:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-13 21:08 McAllister, Colin
2023-09-13 21:34 ` Frank Ch. Eigler
2023-09-14  6:34 ` Ulf Hermann
2023-09-14 19:44   ` McAllister, Colin
2023-09-15  6:57     ` Ulf Hermann
2023-09-15 15:42       ` McAllister, Colin [this message]
2023-09-15 21:00     ` Mark Wielaard
2023-09-16  7:17       ` Ulf Hermann
2023-09-16  7:33         ` Ulf Hermann
2023-11-01 13:05           ` Mark Wielaard
2023-09-16 19:24         ` Milian Wolff
2023-09-18 13:18         ` McAllister, Colin
2023-09-18 15:45           ` Frank Ch. Eigler
2023-11-01 13:15           ` Mark Wielaard

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=SA2PR04MB7723A3AF47D771A31F8F7ABFF4F6A@SA2PR04MB7723.namprd04.prod.outlook.com \
    --to=colin.mcallister@garmin.com \
    --cc=elfutils-devel@sourceware.org \
    --cc=ulf.hermann@qt.io \
    /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).