delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2024/05/09/13:44:19

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
X-Recipient: djgpp-workers AT delorie DOT com
Message-ID: <2b86685a-ec42-4123-8703-cebe1d0c78ef@iki.fi>
Date: Thu, 9 May 2024 20:44:11 +0300
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
To: djgpp-workers AT delorie DOT com
From: "=?UTF-8?Q?Andris_Pav=C4=93nis?= (andris DOT pavenis AT iki DOT fi) [via djgpp-workers AT delorie DOT com]" <djgpp-workers AT delorie DOT com>
Subject: gcc-14.1.0 DJGPP cross-compiler build for ArchLinux
Reply-To: djgpp-workers AT delorie DOT com

Tried to build GCC 14.1.0 as Linux -to-DJGPP cross-compiler in Arch Linux.

See https://aur.archlinux.org/packages/djgpp-gcc

Some short tests:

1) small test program (gcc-14+ required, will not compile with gcc-13 or earlier versions, also 
c++20 or higher required)

#include <iostream>
#include <chrono>

using namespace std::chrono;

$ cat test1.cpp
#include <iostream>
#include <chrono>

using namespace std::chrono;

int main(void)
{
     const time_zone* tz = locate_zone("Europe/Helsinki");
     const time_zone* tz2 = locate_zone("Etc/UTC");
     const auto local_time = tz->to_local(system_clock::now());
     const zoned_time<nanoseconds> ldt(tz, local_time);
     const zoned_time<nanoseconds> utc(tz2, ldt);
     std::cout << std::format("{:%Y-%m-%d %H:%M:%S%Oz}", ldt) << std::endl;
     std::cout << std::format("{:%Y-%m-%d %H:%M:%S%Oz}", utc) << std::endl;
     return 0;
}

Compiling:

i686-pc-msdosdjgpp-g++ -std=c++20 -O2 test1.cpp -o test1.exe

Copied EXE file to my ancient test notebook and tried: seems to work correctly when environment 
variable TZ is set (Europe/Helsinki in my case)

It is not getting time very accurately (10 ms step) however.

Also tried to build https://aur.archlinux.org/packages/djgpp-djcrx-cvs for testing. Seems to work 
and records rather many GCC static analyzer messages (edited compiler options to remove -Werror and 
to enable static analyzer)


Andris



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019