-
Notifications
You must be signed in to change notification settings - Fork 0
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
Trick to compiling? #1
Comments
On Wednesday, March 2, 2022, helpdeskdan ***@***.***> wrote:
Am I doing this wrong? Do I need clang? I get tons of u_int vs uint
errors, time.h is not sys/time.h - I've got to be doing something terrible
wrong. Tips appreciated, thanks.
yes, i only tried to compile this in clang/termux environment.
can you look around (in Makefile may be) if XOPEN_SOURCE defined somewhere?
if yes - try to remove it?
https://oleherman.com/dev/unknown_type_name/
… —
Reply to this email directly, view it on GitHub
<#1>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJSS7TJ4ATOQ5UCHMUJSXRLU56CQBANCNFSM5PXZJICQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
The makefile's just a gcc command, there's no XOPEN anywhere in any file. I cobbled the time.h and endian.h, but it's still a bag of worms. I'm afraid I'm no C programmer.
|
On Wednesday, March 2, 2022, helpdeskdan ***@***.***> wrote:
The makefile's just a gcc command, there's no XOPEN anywhere in any file.
There's no XOPEN anywhere. I cobbled the time.h and endian.h, but it's
still a bad of worms. I'm afraid I'm no C programmer.
In file included from udf_create.h:39,
from udf_write.c:52:
udf_bswap.h:33:10: fatal error: sys/endian.h: No such file or directory
33 | #include <sys/endian.h>
try to add few more places with inclydes (gcc -I..)?
protocolbuffers/protobuf#8373
might give some info about where those files located on different
systems...
… —
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJSS7TOHTLQD4HCRAVHWECTU56R6FANCNFSM5PXZJICQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.Message ID:
***@***.***>
|
Like I said, I got rid of a couple errors, but there's a lot. Got time to look?
|
On Wednesday, March 2, 2022, helpdeskdan ***@***.***> wrote:
Like I said, I got rid of a couple errors, but there's a lot. Got time to
look?
gcc *.c -o newfs_udf
newfs_udf.c: In function ‘usage’:
newfs_udf.c:824:57: warning: implicit declaration of function ‘getprogname’ [-Wimplicit-function-declaration]
824 | "[-t gmtoff] [-v min_udf] [-V max_udf] special\n", getprogname());
| ^~~~~~~~~~~
newfs_udf.c:822:33: warning: format ‘%s’ expects argument of type ‘char *’, but argument 3 has type ‘int’ [-Wformat=]
822 | (void)fprintf(stderr, "Usage: %s [-cFM] [-L loglabel] "
| ~^
| |
| char *
| %d
823 | "[-P discid] [-S sectorsize] [-s size] [-p perc] "
824 | "[-t gmtoff] [-v min_udf] [-V max_udf] special\n", getprogname());
| ~~~~~~~~~~~~~
| |
| int
newfs_udf.c: In function ‘main’:
newfs_udf.c:840:2: warning: implicit declaration of function ‘setprogname’ [-Wimplicit-function-declaration]
840 | setprogname(argv[0]);
| ^~~~~~~~~~~
newfs_udf.c:852:26: warning: implicit declaration of function ‘time’; did you mean ‘utimes’? [-Wimplicit-function-declaration]
852 | srandom((unsigned long) time(NULL));
| ^~~~
| utimes
newfs_udf.c:865:7: warning: implicit declaration of function ‘localtime’ [-Wimplicit-function-declaration]
865 | tm = localtime(&now);
| ^~~~~~~~~
newfs_udf.c:865:5: warning: assignment to ‘struct tm *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
865 | tm = localtime(&now);
| ^
newfs_udf.c:866:21: error: dereferencing pointer to incomplete type ‘struct tm’
yeah, time.h probably differs... between termux and real Linux
will look into this
866 | context.gmtoff = tm->tm_gmtoff;
| ^~
udf_create.c:33:9: error: expected declaration specifiers or ‘...’ before string constant
33 | __RCSID("$NetBSD: udf_create.c,v 1.30 2021/08/20 20:25:26 andvar Exp $");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from udf_create.c:46:
unicode.h: In function ‘wget_utf8’:
unicode.h:69:53: error: expected declaration specifiers before ‘__unused’
69 | static u_int16_t wget_utf8(const char **, size_t *) __unused;
| ^~~~~~~~
unicode.h:70:49: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__unused’
try to add
#define __unused __attribute__((__unused__))
before those lines ?
idea copied from bionic libc/termux's sys/cdefs.h
…
70 | static int wput_utf8(char *, size_t, u_int16_t) __unused;
| ^~~~~~~~
unicode.h:78:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
78 | {
| ^
unicode.h:132:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
132 | {
| ^
In file included from udf_create.h:33,
from udf_create.c:47:
—
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJSS7TLGHLE3D7TDRB2SNO3U5627RANCNFSM5PXZJICQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.Message ID:
***@***.***>
|
there is also libbsd https://libbsd.freedesktop.org/wiki/ |
Well... that does seem to help a little. The unused def helps. Let's see.... put a "stdint.h" here, a sys/time.h there.... linking error! Nuts! getprogname is in bsd/stdlib.h, not sure how to get it work.
|
On Thursday, March 3, 2022, helpdeskdan ***@***.***> wrote:
gcc *.c -o newfs_udf `pkg-config --cflags libbsd-overlay
Well... that does seem to help a little. The unused def helps. Let's
see.... put a "stdint.h" here, a sys/time.h there.... linking error! Nuts!
getprogname is in bsd/stdlib.h, not sure how to get it work.
add also 'pkg-config --libs libbsd-overlay'?
… gcc *.c -o newfs_udf `pkg-config --cflags libbsd-overlay`
udf_create.c: In function ‘udf_calculate_disc_layout’:
udf_create.c:412:48: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘uint64_t’ {aka ‘long unsigned int’} [-Wformat=]
412 | printf("Total space on this medium approx. %llu KiB, %llu MiB\n",
| ~~~^
| |
| long long unsigned int
| %lu
413 | kbsize/1024, kbsize/(1024*1024));
| ~~~~~~~~~~~
| |
| uint64_t {aka long unsigned int}
udf_create.c:412:58: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘uint64_t’ {aka ‘long unsigned int’} [-Wformat=]
412 | printf("Total space on this medium approx. %llu KiB, %llu MiB\n",
| ~~~^
| |
| long long unsigned int
| %lu
413 | kbsize/1024, kbsize/(1024*1024));
| ~~~~~~~~~~~~~~~~~~
| |
| uint64_t {aka long unsigned int}
udf_create.c:416:47: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘uint64_t’ {aka ‘long unsigned int’} [-Wformat=]
416 | printf("Free space on this volume approx. %llu KiB, %llu MiB\n\n",
| ~~~^
| |
| long long unsigned int
| %lu
417 | kbsize/1024, kbsize/(1024*1024));
| ~~~~~~~~~~~
| |
| uint64_t {aka long unsigned int}
udf_create.c:416:57: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘uint64_t’ {aka ‘long unsigned int’} [-Wformat=]
416 | printf("Free space on this volume approx. %llu KiB, %llu MiB\n\n",
| ~~~^
| |
| long long unsigned int
| %lu
417 | kbsize/1024, kbsize/(1024*1024));
| ~~~~~~~~~~~~~~~~~~
| |
| uint64_t {aka long unsigned int}
udf_create.c: In function ‘udf_add_logvol_part_sparable’:
udf_create.c:980:11: warning: taking address of packed member of ‘struct part_map_spare’ may result in an unaligned pointer value [-Waddress-of-packed-member]
980 | st_pos = &pmap->pms.st_loc[0];
| ^~~~~~~~~~~~~~~~~~~~
udf_create.c: In function ‘udf_update_lvintd’:
udf_create.c:1203:8: warning: taking address of packed member of ‘struct logvol_int_desc’ may result in an unaligned pointer value [-Waddress-of-packed-member]
1203 | pos = &lvid->tables[0];
| ^~~~~~~~~~~~~~~~
udf_create.c: In function ‘udf_extattr_append_internal’:
udf_create.c:1784:23: warning: taking address of packed member of ‘struct impl_extattr_entry’ may result in an unaligned pointer value [-Waddress-of-packed-member]
1784 | spos = (uint16_t *) implext->data;
| ^~~~~~~
/usr/bin/ld: /tmp/ccudWxD2.o: in function `usage':
newfs_udf.c:(.text+0x121d): undefined reference to `getprogname'
/usr/bin/ld: /tmp/ccudWxD2.o: in function `main':
newfs_udf.c:(.text+0x1282): undefined reference to `setprogname'
/usr/bin/ld: newfs_udf.c:(.text+0x16ec): undefined reference to `bsd_getopt'
collect2: error: ld returned 1 exit status
make: *** [Makefile:2: all] Error 1
—
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJSS7TJIMY5ULLW5RYY7CN3U6DKG7ANCNFSM5PXZJICQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.Message ID:
***@***.***>
|
Say, that might have done it!
Few warnings: gcc *.c -o newfs_udf `pkg-config --cflags libbsd-overlay pkg-config --libs libbsd-overlay`
udf_create.c: In function ‘udf_calculate_disc_layout’:
udf_create.c:412:48: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘uint64_t’ {aka ‘long unsigned int’} [-Wformat=]
412 | printf("Total space on this medium approx. %llu KiB, %llu MiB\n",
| ~~~^
| |
| long long unsigned int
| %lu
413 | kbsize/1024, kbsize/(1024*1024));
| ~~~~~~~~~~~
| |
| uint64_t {aka long unsigned int}
udf_create.c:412:58: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘uint64_t’ {aka ‘long unsigned int’} [-Wformat=]
412 | printf("Total space on this medium approx. %llu KiB, %llu MiB\n",
| ~~~^
| |
| long long unsigned int
| %lu
413 | kbsize/1024, kbsize/(1024*1024));
| ~~~~~~~~~~~~~~~~~~
| |
| uint64_t {aka long unsigned int}
udf_create.c:416:47: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘uint64_t’ {aka ‘long unsigned int’} [-Wformat=]
416 | printf("Free space on this volume approx. %llu KiB, %llu MiB\n\n",
| ~~~^
| |
| long long unsigned int
| %lu
417 | kbsize/1024, kbsize/(1024*1024));
| ~~~~~~~~~~~
| |
| uint64_t {aka long unsigned int}
udf_create.c:416:57: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘uint64_t’ {aka ‘long unsigned int’} [-Wformat=]
416 | printf("Free space on this volume approx. %llu KiB, %llu MiB\n\n",
| ~~~^
| |
| long long unsigned int
| %lu
417 | kbsize/1024, kbsize/(1024*1024));
| ~~~~~~~~~~~~~~~~~~
| |
| uint64_t {aka long unsigned int}
udf_create.c: In function ‘udf_add_logvol_part_sparable’:
udf_create.c:980:11: warning: taking address of packed member of ‘struct part_map_spare’ may result in an unaligned pointer value [-Waddress-of-packed-member]
980 | st_pos = &pmap->pms.st_loc[0];
| ^~~~~~~~~~~~~~~~~~~~
udf_create.c: In function ‘udf_update_lvintd’:
udf_create.c:1203:8: warning: taking address of packed member of ‘struct logvol_int_desc’ may result in an unaligned pointer value [-Waddress-of-packed-member]
1203 | pos = &lvid->tables[0];
| ^~~~~~~~~~~~~~~~
udf_create.c: In function ‘udf_extattr_append_internal’:
udf_create.c:1784:23: warning: taking address of packed member of ‘struct impl_extattr_entry’ may result in an unaligned pointer value [-Waddress-of-packed-member]
1784 | spos = (uint16_t *) implext->data;
| ^~~~~~~ |
Granted, Linux lacking UDF 2.5 write support, I've accomplished rather a Pyrrhic victory with no ability to put anything on said filesystem.... |
On Thursday, March 3, 2022, helpdeskdan ***@***.***> wrote:
Granted, Linux lacking UDF 2.5 write support, I've accomplished rather a
Pyrrhic victory with no ability to put anything on said filesystem....
and sadly makefs can't put anything in 2.01+ images too...
I used this line for booting netbsd livecd and then mounting device from
inside VM (i used VNC because it was faster on termux, you can use usual
sdl/gtk3 interface..)
qemu-system-i386 -device sb16 -nic user,model=ne2k_pci \
-accel tcg,tb-size=64 -vnc :1 -boot d -vga cirrus \
-cpu pentium2 -m 320 -hda udfimg.img -cdrom netbsd-92-boot.iso
but netbsd's drive notation a bit different from Linux, you better to
consult netbsd's man online
https://man.netbsd.org/NetBSD-5.0/mount_udf.8
in our case it will be wd0* device (not sure wich one exactly)
… —
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJSS7TKCXYSCI7AAAWBEND3U6DTC7ANCNFSM5PXZJICQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.Message ID:
***@***.***>
|
2.01 is supposed to be R/W in Linux. (Disclaimer: Haven't tried) |
Am I doing this wrong? Do I need clang? I get tons of u_int vs uint errors, time.h is not sys/time.h - I've got to be doing something terrible wrong. Tips appreciated, thanks.
The text was updated successfully, but these errors were encountered: