-
-
Notifications
You must be signed in to change notification settings - Fork 645
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
Unable to have Ape binaries be zip's using amalgamated build files(using external build system) #214
Comments
Can you provide a minimal example? The below example works: hello.c: #include <stdio.h>
#include <time.h>
#ifdef COSMOPOLITAN_H_
STATIC_YOINK("usr/share/zoneinfo/Beijing");
// yoinking __zip_start or zip_uri_support doesn't work
#endif
int main(int argc, char **argv) {
#ifdef COSMOPOLITAN_H_
showcrashreports();
FILE *f = fopen("zip:sample.txt", "r");
char buf[128];
if(feof(f)) return 1;
printf("viewing file:\n");
while(fgets(buf, sizeof(buf), f) != NULL)
printf("%s\n", buf);
fclose(f);
#endif
return 0;
} Compilation: gcc hello.c -std=gnu99 -g3 -Og \
-static -nostdlib -nostdinc -fno-pie \
-mno-red-zone -fno-omit-frame-pointer \
-pg -no-pie \
-I../libcosmo/header_stubs/ \
-o hello.com.dbg \
-fuse-ld=bfd \
-Wl,-T,../libcosmo/ape.lds \
-include ../libcosmo/cosmopolitan.h ../libcosmo/crt.o ../libcosmo/ape.o ../libcosmo/cosmopolitan.a
objcopy --strip-all --output-target binary hello.com.dbg hello.com echo "cosmopolitan libc" > sample.txt
zip hello.com sample.txt
unzip -l hello.com
./hello.com
|
Ok so by using the commands you used I was able to make the .com file a zip but only when the .com file was stripped of all debug information. i.e. : @jart is it desired that when the .com file is a .com.dbg that we can't use it as a zip ? If so how would one debug code that uses |
Call
|
I am trying to build ape files as archives to store application data using the amalgamated files supplied for the build.
I tried doing what was outlined here: #166 but no cigar.
I am able to build the ape files using the commands shown here but they don't have the PK begin and end signatures.
Building on Debian 10 with default gcc.
The text was updated successfully, but these errors were encountered: