Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: cosmo.zip ranlib not working out of the box #1325

Open
danieldulaney opened this issue Nov 20, 2024 · 2 comments
Open

Bug: cosmo.zip ranlib not working out of the box #1325

danieldulaney opened this issue Nov 20, 2024 · 2 comments
Labels
medium severity Used to report medium severity bugs (e.g. Malfunctioning Features but still useable)

Comments

@danieldulaney
Copy link

Contact Details

dulaney.daniel@gmail.com

What happened?

I downloaded the pre-built cosmocc, then tried to run cosmoranlib:

mkdir -p cosmocc
cd cosmocc
wget https://cosmo.zip/pub/cosmocc/cosmocc.zip
unzip cosmocc.zip

By default, cosmoranlib is non-executable, though it looks like a valid shell script:

ls -l bin/cosmoranlib
-rw-rw-r-- 1 ddulaney ddulaney 46 Oct 17 04:23 bin/cosmoranlib

That's fine, instead I'll just run x86_64-linux-cosmo-ranlib directly, which is an executable:

bin/x86_64-linux-cosmo-ranlib --version
zsh: exec format error: bin/x86_64-linux-cosmo-ranlib

It looks like cosmoranlib doesn't work out of the box.

Version

cosmocc (GCC) 14.1.0

What operating system are you seeing the problem on?

Linux

Relevant log output

% bin/x86_64-linux-cosmo-ranlib --version
zsh: exec format error: bin/x86_64-linux-cosmo-ranlib

% cat /etc/*release*
NAME="Rocky Linux"
VERSION="9.4 (Blue Onyx)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="9.4"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Rocky Linux 9.4 (Blue Onyx)"
ANSI_COLOR="0;32"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:rocky:rocky:9::baseos"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
SUPPORT_END="2032-05-31"
ROCKY_SUPPORT_PRODUCT="Rocky-Linux-9"
ROCKY_SUPPORT_PRODUCT_VERSION="9.4"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.4"
Rocky Linux release 9.4 (Blue Onyx)
Rocky Linux release 9.4 (Blue Onyx)
Derived from Red Hat Enterprise Linux 9.4
Rocky Linux release 9.4 (Blue Onyx)
cpe:/o:rocky:rocky:9::baseos
@danieldulaney danieldulaney added the medium severity Used to report medium severity bugs (e.g. Malfunctioning Features but still useable) label Nov 20, 2024
@ahgamut
Copy link
Collaborator

ahgamut commented Nov 21, 2024

can you try using sh or bash instead of zsh? Perhaps it's related to #427

@danieldulaney
Copy link
Author

That looks like it!

Does it make sense to take the cosmocc/cosmoar scripts and set up cosmoranlib the same way?

% bash
[ddulaney@my-server ~]$ mkdir -p /scratch/temp/cosmocc
[ddulaney@my-server ~]$ cd /scratch/temp/cosmocc/
[ddulaney@my-server cosmocc]$ wget https://cosmo.zip/pub/cosmocc/cosmocc.zip
# ... snip successful wget output ...
[ddulaney@my-server cosmocc]$ unzip cosmocc.zip
# ... snip successful unzip output ...
[ddulaney@my-server cosmocc]$ ls -lah bin/cosmoranlib
-rw-rw-r-- 1 ddulaney ddulaney 46 Oct 17 04:23 bin/cosmoranlib
[ddulaney@my-server cosmocc]$ bin/x86_64-linux-cosmo-ranlib --version
GNU ranlib (GNU Binutils) 2.42
Copyright (C) 2024 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium severity Used to report medium severity bugs (e.g. Malfunctioning Features but still useable)
Projects
None yet
Development

No branches or pull requests

2 participants