From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, NICE_REPLY_A autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 7281 invoked from network); 14 Mar 2021 20:36:38 -0000 Received: from hurricane.the-brannons.com (2602:ff06:725:1:20::25) by inbox.vuxu.org with ESMTPUTF8; 14 Mar 2021 20:36:38 -0000 Received: from localhost.localdomain (localhost [127.0.0.1]) by hurricane.the-brannons.com (OpenSMTPD) with ESMTP id 27bbe3e7 for ; Sun, 14 Mar 2021 13:36:32 -0700 (PDT) Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [2a00:1450:4864:20::435]) by hurricane.the-brannons.com (OpenSMTPD) with ESMTPS id 7c032106 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Sun, 14 Mar 2021 13:36:08 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id f12so7648150wrx.8 for ; Sun, 14 Mar 2021 13:36:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=geoffair-info.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=oJjYM5wxIG2X4R7Sf8ym7mJMWhNq6g4vBPYG2nWSuoA=; b=RRb0e9oz8nhN/ZCRIShrk3Zk6f2PBQX5DEZ2ROf+orsMgbXWBMPllMUOUXvxj8VgqQ cVGIXOA4bzaHa/SRfKPGpGi81hQ8J21sav6j6OnM5WKdkUKfMmQqOLMcCHipUbNEN6To T/UWFe87kLzNDT1Mjs4MiSr2tHhkk6LLEsCqnkji1YjHPOcf3A3j+oSG4hUyGbs3HnTV znmQMHm/A2VIiis1uCS/1ZBtKfJoVt2GSDKlXzm9cEBDF5nM0+6nkdBMK64yoYB5h9gZ carSM6TexlyCbYt88Pscu9I94rrW0TU8EEPj0fMtcz2n/f9fRG0is0WMStOxEExfnqdc tUjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=oJjYM5wxIG2X4R7Sf8ym7mJMWhNq6g4vBPYG2nWSuoA=; b=WmrcFTJVIjQCeUm1zWnrLaGsaWtQIaw8SwkH3oUGgtWIjkGMvWa7btSiNEX2QVyT0f 5GZUwH8Z+29vISeZ20r2GU16y8PEQAHc9V8vKKbdCKcyO35tGcFVyZZhG2XaUORumPQn vYG5ACqjG9xE1L2kArGA0QawKUnY0I0WLxKWtD0dF/WNx+XoKsI3vkfakZCsZLqlH6Md pVOUmee9h1I5W0vVk19h2TYFq1Dqsg9uYfnEv8VUHIl0zrptB+vTI5UH/aCvzg26HrrL 6CKjJOniJ10jy6Qk6xJ7+NOSTmXQofsc9s3AhvR6W19wrWyvrkCBh/6OOfZwZLkmt+5V L1Pg== X-Gm-Message-State: AOAM530sc7UYtEuKqtS/YdTtla2JWSxAuOyiBi9RGsVVBSeKgMqGy5eF JhNOTBZdt85OiCwjMT4aI5vYJQ== X-Google-Smtp-Source: ABdhPJx8a77qQ4T+1zhvpCDM+XXuX7Il2kxVgCa3iBShDm1w09N2pXziOPFOK1NH1gOD6gnFtpMEfA== X-Received: by 2002:adf:c186:: with SMTP id x6mr24454472wre.253.1615754163666; Sun, 14 Mar 2021 13:36:03 -0700 (PDT) Received: from ?IPv6:2a01:cb00:9f8:e600:1531:31bc:65b7:d97a? (2a01cb0009f8e600153131bc65b7d97a.ipv6.abo.wanadoo.fr. [2a01:cb00:9f8:e600:1531:31bc:65b7:d97a]) by smtp.googlemail.com with ESMTPSA id g16sm17198192wrs.76.2021.03.14.13.36.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 14 Mar 2021 13:36:03 -0700 (PDT) Subject: Re: [edbrowse-dev] quick js To: Karl Dahlke , Edbrowse-dev@lists.the-brannons.com, Kevin Carhart References: <20210207082610.eklhad@comcast.net> <8503ef17-5a2d-a160-dfd5-4b30ba380453@geoffair.info> <20210210053836.eklhad@comcast.net> From: Geoff McLane Message-ID: <3e29432c-e762-2f0a-c01c-9fc809738d7e@geoffair.info> Date: Sun, 14 Mar 2021 21:36:02 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 X-BeenThere: edbrowse-dev@edbrowse.org List-Id: Edbrowse Development List MIME-Version: 1.0 In-Reply-To: <20210210053836.eklhad@comcast.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US 20210314: Building the QuickJS library update Just an update... persued 4 different tracks... some success, some failures... they are - 1. Using mingw-64 emulator - OK, but todo edbrowse with same mingw... 2. Using MSVC 2019 native .x64 - got close, but close is not good enough 3. Using the MS WSL emulator - wow, a million steps to do... so far only built tidy, edbrowse, ... 4. Using github.com/c-smile/quickjspp - the premake5.exe tool FAILED to build MSVC solution... hmmmm... The detailed exploration is below... or jump to the 'Summary:' 1. Using mingw-64 ################### Encountered an error, I can NOT seem to get past... but sort of got there, eventually... [  9%] Building C object CMakeFiles/quickjs.dir/quickjs.c.obj D:\mingw-w64\mingw64\bin\gcc.exe -DCONFIG_BIGNUM -DCONFIG_VERSION=\"2020-11-08\" -D_GNU_SOURCE \  -Wall -Wno-array-bounds -Wno-format-truncation -Wno-unused-variable -Wno-unused-but-set-variable \ -MMD -MF -O  -D_REENTRANT -O3 -DNDEBUG   -o CMakeFiles\quickjs.dir\quickjs.c.obj   -c D:\Projects\quickjs\quickjs.c C:\Users\ubunt\AppData\Local\Temp\cchgmH6R.s: Assembler messages: C:\Users\ubunt\AppData\Local\Temp\cchgmH6R.s:30898: Error: .seh_savexmm offset is negative C:\Users\ubunt\AppData\Local\Temp\cchgmH6R.s:30899: Error: .seh_savexmm offset is negative I am using mingw-64, with gcc version (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0 I searched long and hard, but can /NOT/ find an update to my installation of mingw-64 - from - http://mingw-w64.org/doku.php/download 2020/05/13  19:30           960,504 mingw-w64-install.exe Appears I have the 'latest'... From here https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86048 found - (a) Which says: "not if -fno-reorder-blocks-and-partition" - to try (b) Eric Botcazou 2018-06-13 11:26:27 UTC This will be fixed in the 8.2 release.  Thanks for reporting the problem. Ok, added '-fno-reorder-blocks-and-partition', and it compiled! WOW ;=)) success!!! Now to figure out how to link edbrowse to this 'libquickjs.a'??? Probably need to build 'edbrowse' using the same emulator... TODO... 2. Using MSVC native ################### A: Fixed the buildin crt with creating a "ctz_clz.h" header which adds these functions.. Add to cutils.h - +#ifdef _MSC_VER +#include "ctz_clz.h" +#define __attribute__(x) +#endif // _MSC_VER + B: Commented out , in various places - like - +#ifndef _MSC_VER  #include +#endif /* #ifndef _MSC_VER */ C: Few other relatively minor fixes in the source... \ D: On __int128 being used. At the moment can not find a patch to cover this... E: Swiched OFF CONFIG_BIGNUM support... eventually got 'quickjs.lib' to build F: Big problem - the 'qjsc' compiler failed to convert 'repl.js' to 'repl.c', and likewise with 'qjscalc.js' to C code... overcame this with copy the generated *.c files from the mingw-64 build... not a good solution! So, I have a 'quickjs.lib'... need to sort out which headers to install - list looks like 'quickjs-atom.h, quickjs-libc.h, quickjs-opcode.h, quickjs.h'... so TODO: finish the INSTALL step... then TODO: build of eb-qjs... 3. More exploration into WSL - it's getting to be much more than expected! ################### Per the install docs - https://docs.microsoft.com/en-us/windows/wsl/install-win10 - Joined the Windows Insiders Program, as requested... hope I do not regret this... do not like words like - you will receive emails, and the only way to stop this (spam), is to un-join the program... well, ok, but not nice... Am running the min version - Microsoft Windows [Version 10.0.19041.804], so that's ok... ran 2021/03/11  18:34        15,282,176 wsl_update_x64.msi Did a Windows feature update, which took about 1/2 hour - must now reboot... Had to jump through some other hoops, installed Ubuntu 20.04... and evenually got an 'Ubuntu' app, which opens as a terminal... and it certainly looks and feels like Ubuntu... Then spent some time setting up this 'bash' terminal... add my own '.bash_aliases'... installed g++, cmake... even git cloned tidy, built, and installed it... TODO: But still to figure out where all this is stored? So presently NO access to my native Windows filesystem... and when in Ubuntu, can't yet access outside of the unix root, '/'... So at this time this is a MAJOR setback... yes I could re-download all the sources... TODO: but... At this time this is no different to using a 2nd machine... And really puts me no closer to building QuickJS in native Windows??? On WSL, in general, so far it feels like a very good linux emulator... single click access to terminal... much faster than a dual boot... just missing the native filesystem access... or at least access to my expansion drives - G: and H: Hmmm, found /mnt/g, /mnt/h, and then /mnt/c and /mnt/d, so do have access to full filesystem... will try some more things... Wow, I have to say that it is quite a 'complete' emulation... maybe more than an 'emulation'... it is running a linux kernel... ubunt@DELL03:~/bin$ hvers Show LSB version 'lsb_release -a' No LSB modules are available. Distributor ID: Ubuntu Description:    Ubuntu 20.04.2 LTS Release:        20.04 Codename:       focal Show version 'uname -a' Linux DELL03 5.4.72-microsoft-standard-WSL2 #1 SMP Wed Oct 28 23:40:43 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux ubunt@DELL03:~/bin$ As indicated, really a 'Virtual Machine'... to download my edbrowse-fork, had to even copy a rca .pub to my github account... And can now see my complete disk system, in terms that I know - A:, B:, C:, ... drives - namely - $ df -H | grep -v /dev/loop Filesystem      Size  Used Avail Use% Mounted on /dev/sdb        270G  2.3G  254G   1% / tmpfs            10G     0   10G   0% /mnt/wsl tools           492G  180G  312G  37% /init none             10G     0   10G   0% /dev none             10G   17k   10G   1% /run none             10G     0   10G   0% /run/lock none             10G     0   10G   0% /run/shm none             10G     0   10G   0% /run/user tmpfs            10G     0   10G   0% /sys/fs/cgroup C:\             492G  180G  312G  37% /mnt/c D:\             1.1T  598G  403G  60% /mnt/d G:\             2.1T  1.6T  430G  79% /mnt/g H:\             2.1T  775G  1.3T  39% /mnt/h There is quite a problem with line endings... git, in native windows, adds CR/LF pair to text/script files, which causes the '#! /bin/sh' shell to break, and need to do 'dos2unix