Mail Archives: djgpp-workers/2024/05/09/13:44:19
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 -