Hey! This project owns!! I'm trying to use a potato 32-bit machine (Eee PC 900), and through cursory exploration, this browser is the best one I could use.
I've got a way to use the browser through an SSH session to a beefier (x64) machine, but it would be really nice to use it locally.
When I try to run make
on the Eee PC I end up with this error:
/home/cn/Code/chawan/.obj/release/cha/@mhtml@sdom.nim.c: In function ‘eqdestroy___htmlZenv_u4842’:
/home/cn/Code/chawan/.obj/release/cha/@mhtml@sdom.nim.c:13854:37: error: passing argument 1 of ‘eqdestroy___htmlZevent_u193’ from incompatible pointer type [-Wincompatible-pointer-types]
13854 | eqdestroy___htmlZevent_u193(dest_p0);
| ^~~~~~~
| |
| tyObject_WindowcolonObjectType___EL0s17z0S6fuskkMmKTujg *
/home/cn/Code/chawan/.obj/release/cha/@mhtml@sdom.nim.c:2710:123: note: expected ‘tyObject_EventTargetcolonObjectType___o09ayfzdpUAEV3PVh3UMzaw *’ but argument is of type ‘tyObject_WindowcolonObjectType___EL0s17z0S6fuskkMmKTujg *’
2710 | Object_EventTargetcolonObjectType___o09ayfzdpUAEV3PVh3UMzaw* objX60gensym5__p0);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/home/cn/Code/chawan/.obj/release/cha/@mhtml@sdom.nim.c: In function ‘eqdestroy___htmlZdom_u28360’:
/home/cn/Code/chawan/.obj/release/cha/@mhtml@sdom.nim.c:14893:35: error: passing argument 1 of ‘eqdestroy___htmlZdom_u748’ from incompatible pointer type [-Wincompatible-pointer-types]
14893 | eqdestroy___htmlZdom_u748(dest_p0);
| ^~~~~~~
| |
| tyObject_AttrDummyElementcolonObjectType___DxBWZljJ9ckNRDEhxVOeozQ *
/home/cn/Code/chawan/.obj/release/cha/@mhtml@sdom.nim.c:14889:118: note: expected ‘tyObject_ElementcolonObjectType___qb8SB9cD9crROTvVoThVo8Hw *’ but argument is of type ‘tyObject_AttrDummyElementcolonObjectType___DxBWZljJ9ckNRDEhxVOeozQ *’
14889 | (tyObject_ElementcolonObjectType___qb8SB9cD9crROTvVoThVo8Hw* objX60gensym13__p0) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
Error: execution of an external program failed: 'gcc -c -w -fmax-errors=3 -flto=auto -march=pentium4 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/home/cn/Code/chawan/lib/monoucha/monoucha -DNOT_LRE_ONLY -DJS_NAN_BOXING -O3 -fno-strict-aliasing -fno-ident -fno-math-errno -I/usr/lib/nim/lib -I/home/cn/Code/chawan/src -o /home/cn/Code/chawan/.obj/release/cha/@mhtml@sdom.nim.c.o /home/cn/Code/chawan/.obj/release/cha/@mhtml@sdom.nim.c'
make: *** [Makefile:81: target/release/bin/cha] Error 1
When I try adding this to nim.cfg
on the x86 machine:
--cpu:i386
--passc:"-m32"
--passL:"-m32"
I get this error
stack trace: (most recent call last)
twtstr.nim(654, 31)
twtstr.nim(641, 24) getIdentMap
/home/cn/code/chawan/src/server/loader.nim(507, 38) template/generic instantiation of `strictParseEnum` from here
/home/cn/code/chawan/src/utils/twtstr.nim(641, 24) Error: illegal conversion from 'ConnectionError' to 'int'
make: *** [Makefile:81: target/release/bin/cha] Error 1
c
Am I doing something wrong to compile it for my potato machine, or is it not supported?
Hi,
potatoes are supported, as long as they run something that somewhat resembles POSIX.
When I try to run
make
on the Eee PC I end up with this error:/home/cn/Code/chawan/.obj/release/cha/@mhtml@sdom.nim.c: In function ‘eqdestroy___htmlZenv_u4842’: /home/cn/Code/chawan/.obj/release/cha/@mhtml@sdom.nim.c:13854:37: error: passing argument 1 of ‘eqdestroy___htmlZevent_u193’ from incompatible pointer type [-Wincompatible-pointer-types] 13854 | eqdestroy___htmlZevent_u193(dest_p0); | ^~~~~~~ | | | tyObject_WindowcolonObjectType___EL0s17z0S6fuskkMmKTujg * /home/cn/Code/chawan/.obj/release/cha/@mhtml@sdom.nim.c:2710:123: note: expected ‘tyObject_EventTargetcolonObjectType___o09ayfzdpUAEV3PVh3UMzaw *’ but argument is of type ‘tyObject_WindowcolonObjectType___EL0s17z0S6fuskkMmKTujg *’ 2710 | Object_EventTargetcolonObjectType___o09ayfzdpUAEV3PVh3UMzaw* objX60gensym5__p0); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /home/cn/Code/chawan/.obj/release/cha/@mhtml@sdom.nim.c: In function ‘eqdestroy___htmlZdom_u28360’: /home/cn/Code/chawan/.obj/release/cha/@mhtml@sdom.nim.c:14893:35: error: passing argument 1 of ‘eqdestroy___htmlZdom_u748’ from incompatible pointer type [-Wincompatible-pointer-types] 14893 | eqdestroy___htmlZdom_u748(dest_p0); | ^~~~~~~ | | | tyObject_AttrDummyElementcolonObjectType___DxBWZljJ9ckNRDEhxVOeozQ * /home/cn/Code/chawan/.obj/release/cha/@mhtml@sdom.nim.c:14889:118: note: expected ‘tyObject_ElementcolonObjectType___qb8SB9cD9crROTvVoThVo8Hw *’ but argument is of type ‘tyObject_AttrDummyElementcolonObjectType___DxBWZljJ9ckNRDEhxVOeozQ *’ 14889 | (tyObject_ElementcolonObjectType___qb8SB9cD9crROTvVoThVo8Hw* objX60gensym13__p0) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ Error: execution of an external program failed: 'gcc -c -w -fmax-errors=3 -flto=auto -march=pentium4 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/home/cn/Code/chawan/lib/monoucha/monoucha -DNOT_LRE_ONLY -DJS_NAN_BOXING -O3 -fno-strict-aliasing -fno-ident -fno-math-errno -I/usr/lib/nim/lib -I/home/cn/Code/chawan/src -o /home/cn/Code/chawan/.obj/release/cha/@mhtml@sdom.nim.c.o /home/cn/Code/chawan/.obj/release/cha/@mhtml@sdom.nim.c' make: *** [Makefile:81: target/release/bin/cha] Error 1
I've seen this codegen bug before on my own 32-bit system with Nim 1.6.14. Then I tried to upgrade to a nightly and it worked, so I figured it was fixed long ago and didn't bother with a workaround ("surely nobody else will notice".) Guess I was wrong :P
So, question: what C compiler and Nim version produces this?
Your hint of nightly pointed me to the right direction! I had been using gcc 14.2.1 and Nim 2.0.8. Updating Nim to 2.3.1 got me a little further, but now I get an error saying
/usr/bin/ld i386:x86-64 architecture of input file `/home/cn/code/chawan/src/utils/../../lib/chaseccomp/chaseccomp.o' is incompatible with i386 output
This is from my attempt on my beefier machine. I am pretty green on the gcc stuff, so I may have done something wrong here!
I haven't tried a later version of nim on the Eee PC yet (where nim is v2.0.4 and gcc is v14.1.1), but perhaps that's the way to go.
~cutenice wrote:
Your hint of nightly pointed me to the right direction! I had been using gcc 14.2.1 and Nim 2.0.8. Updating Nim to 2.3.1 got me a little further, but now I get an error saying
/usr/bin/ld i386:x86-64 architecture of input file `/home/cn/code/chawan/src/utils/../../lib/chaseccomp/chaseccomp.o' is incompatible with i386 output
This is from my attempt on my beefier machine. I am pretty green on the gcc stuff, so I may have done something wrong here!
I'm fairly clueless about cross-compiling, but I think you'd want something like
make CFLAGS=-m32 LDFLAGS=-m32 FLAGS=--cpu:i386
....which chaseccomp's Makefile doesn't respect either for some reason. Apply this first:
--- a/lib/chaseccomp/Makefile +++ b/lib/chaseccomp/Makefile @@ -6,7 +6,7 @@ chasc_defs_%.c: %.chasc common.chasc gen_defs chaseccomp.h ./gen_defs <$< >$@ chasc_defs_%: chasc_defs_%.c - $(CC) $< -o $@ + $(CC) $(CFLAGS) $< -o $@ $(LDFLAGS) %.chasc.expanded: chasc_defs_% ./$< >$@
I haven't tried a later version of nim on the Eee PC yet (where nim is v2.0.4 and gcc is v14.1.1), but perhaps that's the way to go.
Probably it's the easier way. (But it might take a while :)
Correction: CFLAGS, etc. should be at the beginning, like
CFLAGS=... make
. (Otherwise you override all other flags.)
I applied the change to chaseccomp's Makefile, ran a
make clean
, and got a build afterwards! It works on my potato machine now. Thanks a lot for the help!
Nice :)
I'll see if there is an easy workaround for the compiler bug, otherwise I'll just add an entry to troubleshooting.md.
With the latest changes, I could simply run
CFLAGS=-m32 LDFLAGS=-m32 FLAGS=--cpu:i386 make
to cross-compile!I don't know if I have any additional insight from today's exploration.. On Arch I needed these things:
nim-git
from the AUR
- the version available in the repos isn't quite new enough it seems. I think it's related to #12 (at least i got similar looking errors)
- enable the multilib repository in
/etc/pacman.conf
pacman -S lib32-openssl lib32-libxcrypt lib32-ncurses lib32-libssh2
- most of these packages pull packages like
lib32-gcc-libs
andlib32-glibc
which might be useful as well haha- the rest can be eluded from the PKGBUILD in the AUR
Hm... speaking of 32-bit machines, I just tried to build chawan on Ubuntu 16.04 i686. The OS is still more or less up to date (via Ubuntu Pro) with a few exceptions like OpenSSL: repos only provide version 1.0.2g, so I have version 3.4.0 installed in a custom location. Which means I run
pkg-config --cflags openssl
andpkg-config --libs openssl
to get the corresponding CFLAGS and LDFLAGS, then pulled chawan and built it like that:make submodule && CFLAGS="-I/path/to/openssl/include" LDFLAGS="-L/path/to/openssl/lib -lssl -lcrypto" make && sudo make install
The build process has completed without errors, but when running
cha http://google.com
, chawan just exits like that:cha: Can't load http://google.com (URL using bad/illegal format or missing URL)
So, what have I missed? Maybe some other lib I need to install manually?
~skejg wrote:
Hm... speaking of 32-bit machines, I just tried to build chawan on Ubuntu 16.04 i686. The OS is still mostly up to date (via Ubuntu Pro) with a few exceptions like OpenSSL: repos only provide version 1.0.2g, so I have version 3.4.0 installed in a custom location. Which means I run
pkg-config --cflags openssl
andpkg-config --libs openssl
to get the corresponding CFLAGS and LDFLAGS, then pulled chawan and built it like that:make submodule && CFLAGS="-I/path/to/openssl/include" LDFLAGS="-L/path/to/openssl/lib -lssl -lcrypto" make && sudo make install
The build process has completed without errors, but when running
cha http://google.com
, chawan just exits like that:cha: Can't load http://google.com (URL using bad/illegal format or missing URL)
So, what have I missed? Maybe some other lib I need to install manually?
It's a curl error message, so probably libcurl.
It's a curl error message, so probably libcurl.
It was :)
Now it indeed tries to open it, "Connected to http://google.com. Downloading..." message flicks in chawan's status bar, and then it just exits without any error (
cha -V
also quits silently after seemingly trying to open about:chawan). Probably not worth the effort trying to make it work :)Thanks anyway!
~skejg wrote:
It's a curl error message, so probably libcurl.
It was :)
Now it indeed tries to open it, "Connected to http://google.com. Downloading..." message flicks in chawan's status bar, and then it just exits without any error (
cha -V
also quits silently after seemingly trying to open about:chawan). Probably not worth the effort trying to make it work :)Maybe it's just a syscall from an old glibc that triggers the seccomp filter, that would be good to fix.
Could you please post the output of
cha -Vd
?Thanks anyway!
-- View on the web: https://todo.sr.ht/~bptato/chawan/37#event-401670
Could you please post the output of cha -Vd?
Ah, sorry, didn't think about that, here you go:
STDERR: Sandbox violation in buffer: syscall #102 Error in buffer about:chawan fatal.nim(53) sysFatal Error: unhandled exception: pager.nim(3198, 7) `pager.consoleWrapper.container != nil` [AssertionDefect]
And if trying to open an actual URL, then there's also
STDERR: Sandbox violation in network: syscall #102
.
~skejg wrote:
Could you please post the output of cha -Vd?
Ah, sorry, didn't think about that, here you go:
STDERR: Sandbox violation in buffer: syscall #102 Error in buffer about:chawan fatal.nim(53) sysFatal Error: unhandled exception: pager.nim(3198, 7)
pager.consoleWrapper.container != nil
[AssertionDefect]And if trying to open an actual URL, then there's also
STDERR: Sandbox violation in network: syscall #102
.-- View on the web: https://todo.sr.ht/~bptato/chawan/37#event-401699
102 is socketcall(2):
On x86-32, socketcall() was historically the only entry point for the sockets API. However, starting in Linux 4.3, direct system calls are provided on x86-32 for the sockets API. This facilitates the creation of seccomp(2) filters that filter sockets system calls.
socketcall makes it impossible to filter for UNIX sockets in a way that doesn't also let through arbitrary TCP/IP connections. It seems, with such an old libc/kernel, the only solution is to disable seccomp:
[...] make DANGER_DISABLE_SANDBOX=1
.
the only solution is to disable seccomp
And it worked, thanks again! :)
Added a note about the issue to the readme, and included cutenice's cross compiling instructions in build.md (thanks!)