News for hackers. Stuff that matters.
Re:Cosmopolitan Libc v2.0 by stephc_int13 on Saturday August 20, 2022 @10:19AM (#32532221)
There is a strong need for a good, modern and well maintained cross-platform C/C++ libc.

I am not sure about the APE executable format, it is a nice and technically impressive feature but I would not mind if the lib dropped the support for it in the future.

This might be a minor issue for some, but I do not like having to distribute a .com file, it look suspicious.

Overall, this is fantastic work, very useful and inspiring, the kind of project that could help to fuel a C based apps renaissance.

Re:Cosmopolitan Libc v2.0 by jart on Saturday August 20, 2022 @10:40AM (#32532368)
We support that. If you want a freedom-optimized build:

    make -j16 MODE=tinylinuxbsd
Will produce ELF executables that run on Linux, FreeBSD, NetBSD, and OpenBSD. You'll never have to worry about being red-flagged by Microsoft. You won't have worry about Apple breaking your binaries. You won't have to worry about Glibc's license or wine binfmt_misc issues. Your binaries will be smaller, starting at 8kb in size. It's real nice and still supports 4x more platforms than the existing tools. If you use it, please note that "tiny" modes disable a lot of cool features like --ftrace and --strace. You can turn them back on by putting:

    ifeq ($(MODE), linuxbsd)
    CONFIG_CPPFLAGS += \
      $(BACKTRACES) \
      $(FTRACE) \
      -DSYSDEBUG \
      -DSUPPORT_VECTOR=113 \
      -O2
    TARGET_ARCH ?= \
      -msse3
    endif
In either ~/.cosmo.mk or build/config.mk. Then you'd say `make MODE=linuxbsd`. We also ship a `tinylinux` prebuilt amalgamation on https://justine.lol/cosmopolitan/download.html

Lastly, you can always change the .com extension to .exe. I would have chosen the latter, but I think UNIX has more in common with DOS than it does with Windows. I know people in the Microsoft camp hold negative associations with .com. But I didn't want people in other camps to think APE is just a Windows program.

Re:Cosmopolitan Libc v2.0 by stephc_int13 on Saturday August 20, 2022 @10:52AM (#32532456)
Are you sure that a .com executable can be renamed as .exe and still work on Windows?

Unfortunately Windows might not be that smart.

I really like the tiny ELF executable running on any unix, very neat and not scary.

Having the same style of release for macOS and Win32 would be perfect.

Re:Cosmopolitan Libc v2.0 by jart on Saturday August 20, 2022 @10:56AM (#32532471)
Yes I'm sure. On Windows .com and .exe are the same thing. If you want just a Windows binary without any APE, you can use -DSUPPORT_VECTOR=4 and just change the .com extension to .exe. If you want just a MacOS binary, then use -DSUPPORT_VECTOR=8 and then run the assimilate.com program with the -m flag to convert it to Mach-O.
Re:Cosmopolitan Libc v2.0 by FragenAntworten on Saturday August 20, 2022 @11:01AM (#32532511)