Can't get LuaJIT to compile with cygwin - cygwin

I am trying to install the latest version of LuaJIT on Windows. I followed the instructions for installing LuaJIT as best I could. I installed cygwin and the make packages, opened cygwin, cded to the unzipped source folder, and typed make. I get this output:
$ make
==== Building LuaJIT 2.0.3 ====
make -C src
make[1]: Entering directory '/cygdrive/c/Users/Daniel/Downloads/LuaJIT-2.0.3/LuaJIT-2.0.3/src'
CC lj_alloc.o
lj_alloc.c:249:2: error: #error "NYI: need an equivalent of MAP_32BIT for this 64 bit OS"
#error "NYI: need an equivalent of MAP_32BIT for this 64 bit OS"
^
lj_alloc.c: In function ‘direct_alloc’:
lj_alloc.c:742:5: warning: implicit declaration of function ‘CALL_MMAP’ [-Wimplicit-function-declaration]
char *mm = (char *)(DIRECT_MMAP(mmsize));
^
lj_alloc.c:742:16: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
char *mm = (char *)(DIRECT_MMAP(mmsize));
^
lj_alloc.c: In function ‘alloc_sys’:
lj_alloc.c:911:18: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
char *mp = (char *)(CALL_MMAP(rsize));
^
lj_alloc.c: In function ‘lj_alloc_create’:
lj_alloc.c:1143:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
tbase = (char *)(CALL_MMAP(tsize));
^
Makefile:647: recipe for target 'lj_alloc.o' failed
make[1]: *** [lj_alloc.o] Error 1
make[1]: Leaving directory '/cygdrive/c/Users/Daniel/Downloads/LuaJIT-2.0.3/LuaJIT-2.0.3/src'
Makefile:103: recipe for target 'default' failed
make: *** [default] Error 2
Searching for any of these error messages turns up nothing. What did I do wrong?

If you read the documentation you'll see that cygwin64 is not yet supported, only 32 bit.
http://luajit.org/install.html
However it doesn't look hard to add support to it. Just try.
e.g. the documentation suggests:
Configuring LuaJIT
The standard configuration should work fine for most installations. Usually there is no need to tweak the settings. The following files hold all user-configurable settings:
src/luaconf.h sets some configuration variables.
Makefile has settings for installing LuaJIT (POSIX only).
src/Makefile has settings for compiling LuaJIT under POSIX, MinGW or Cygwin.
src/msvcbuild.bat has settings for compiling LuaJIT with MSVC or WinSDK.
Please read the instructions given in these files, before changing any settings.
So fixing src/Makefile seems to be the easiest. Unfortunately I'm a bit sick currently and cannot do it right now.
I've looked a bit and this patch fixes the CALL_MMAP problem:
--- src/lj_alloc.c~ 2014-03-23 20:47:09.000000000 -0500
+++ src/lj_alloc.c 2014-03-23 20:47:54.145877000 -0500
## -188,7 +188,7 ##
return ptr;
}
-#elif LJ_TARGET_OSX || LJ_TARGET_PS4 || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__sun__)
+#elif LJ_TARGET_OSX || LJ_TARGET_PS4 || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__sun__) || defined(__CYGWIN__)
/* OSX and FreeBSD mmap() use a naive first-fit linear search.
** That's perfect for us. Except that -pagezero_size must be set for OSX,
Add a __CYGWIN__ check.
Now just the lj_err_unwind_win64 unwinder is not linked. This is for Mike Pall now. Not sure if EXT or INT is appropriate and how it is linked.

For what it's worth: LuaJIT-2.1.0-beta2 (available now at luajit.org download) builds fine on Cygwin 64; no hacking required.

Related

How can I compile simpleScalar in cygwin using alpha configuration?

I need to install simplescalar on windows 7. For that reason, I installed cygwin. I need to use simplescalar because I need to do a lab about Benchmarks.
I already installed SimpleScalar on Debian and I compiled it using the alpha configuration without any problem. However, when I try to do the same on windows using cygwin, I'm having issues.
I am trying to compile simplescalar using alpha configuration. since I'm using windows 7, cygwin and I used the following steps:
make config-alpha
make
When I run the make command to compile the simulator, it shows me a lot of errors.
syscall.c: 805:25: error: 'TCP_NODELAY' undeclared here (not in a function); did you mean 'O_NDEALY'?
804 { OSF_TCP_NODELAY, TCP_NODELAY},
O_NDEALY
syscall.c: 805:25: error: 'TCP_MAXSEG' undeclared here (not in a function); did you mean 'TMP_MAX'?
804 { OSF_TCP_MAXSEG, TCP_MAXSEG},
TMP_MAX
syscall.c:2636:56 error: invalid use of undefined type 'struct dirent' i++, cnt < regs -> regs_R[MD_REG_V0] && p->d_reclen > 0;
syscall.c:2637:35 error: invalid use of undefined type 'struct dirent' i++, cnt = p->d_reclen, p=(struct dirent *)(buf+cn 2637)
However, if I use pisa configuration, I can compile the simulator without any problem.
Is there any additional steps I need to do or any additional packages I need to download in cygwin in order to compile simplescala using alpha configuration?
Some of the packages that I have downloaded to do my lab in cygwin have been wget, nano and devel.

Running gem5 with DramSim2

So I've been able to build gem5 and run full system simulation . Now i want to integrate it with dramSim2 .I cloned the dramsim2 into ext directory in gem5. I ran the following command to build the .opt file
again
scons build/ARM/gem5.opt
The error it throws is -
build/dramsim2/DRAMSim2/BusPacket.cpp: In member function 'void
DRAMSim::BusPacket::print(uint64_t, bool)':
build/dramsim2/DRAMSim2/BusPacket.cpp:63:2: error: nonnull
argument
'this' compared to NULL [-Werror=nonnull-compare]
if (this == NULL)
^~
build/dramsim2/DRAMSim2/BusPacket.cpp: In member function 'void
DRAMSim::BusPacket::print()':
build/dramsim2/DRAMSim2/BusPacket.cpp:104:2: error: nonnull
argument
'this' compared to NULL [-Werror=nonnull-compare]
if (this == NULL) //pointer use makes this a necessary precaution
^~
cc1plus: all warnings being treated as errors
scons: *** [build/dramsim2/DRAMSim2/BusPacket.os] Error 1
scons: building terminated because of errors.
Anyone know what it means ?
Dramsim2 is outdated, and its original author stop actively maintaining the project. Although you may want to fix the codes as described here, can you simply test if the build passes the failure point by additionally giving -Wno-nonnull compilation switch?
I solved this problem . I changed gcc, g++ version.
I changed gcc version from 6.0 to 4.8.
Use this command and change the version.
sudo update-alternatives --config gcc
sudo update-alternatives --config g++

error: field 'ctx' has incomplete type EVP_CIPHER_CTX

Problem: I need to install Cepstral (tts engine) into Freeswitch running Debian 8. Freeswitch is already up and running, but I needed to build it from source in order for it create the mod_cepstral module.
When I run make this is the error I get:
In file included from ./crypto/include/prng.h:17:0,
from ./crypto/include/crypto_kernel.h:50,
from ./include/srtp.h:53,
from srtp/srtp.c:46:
./crypto/include/aes_icm_ossl.h:66:20: error: field ‘ctx’ has incomplete type
EVP_CIPHER_CTX ctx;
^~~
In file included from srtp/srtp.c:50:0:
./crypto/include/aes_gcm_ossl.h:58:18: error: field ‘ctx’ has incomplete type
EVP_CIPHER_CTX ctx;
^~~
Makefile:646: recipe for target 'srtp.lo' failed
make[1]: *** [srtp.lo] Error 1
make[1]: Leaving directory '/usr/src/freeswitch/libs/srtp'
Makefile:3931: recipe for target 'libs/srtp/libsrtp.la' failed
make: *** [libs/srtp/libsrtp.la] Error 2
I have been scouring the internet for solutions, but I am not a developer and this is way over my head. Any help would be appreciated.
cause newer OpenSSL don't expose struct EVP_CIPHER_CTX ,
try this
EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();
EVP_CIPHER_CTX_init(ctx);
//do sth here
//...
EVP_CIPHER_CTX_free(ctx);
wget https://github.com/cisco/libsrtp/archive/v2.1.0.tar.gz
tar xfv v2.1.0.tar.gz
cd libsrtp-2.1.0
./configure --prefix=/usr --enable-openssl
make shared_library && sudo make install
Get the latest version of libsrtp.
It appears that there is a dependency on OpenSSL, but the version of OpenSSL you are using is incompatible. You are using OpenSSL 1.1.0 but you need to use OpenSSL 1.0.2
After talking with support at Cepstral, we determined that Jessie (Debian 8) is not yet fully compatible. I rebuilt the server with Debian 7 and it is working fine now.

Building TIC fails (ncurses5.9) for CLFS 3.0.0 SYSTEMD

Recently I decided to retry building a CLFS machine http://www.clfs.org and am at step 5.5 of 3.0.0 SYSTEMD. We are told to run make -C include and then make -C progs tic. I am failing at the last command. Am I missing any packages, or am I doing something wrong?
I am using ArchLinux as my CLFS host in VMWare which is running on Windows 10.
Here is the page I am looking at for the commands: http://clfs.org/files/BOOK/3.0.0/SYSTEMD/view/x86_64/cross-tools/ncurses.html
Here is the output from the console when I run that last command:
In file included from ../ncurses/curses.priv.h:283:0,
from ../ncurses/lib_gen.c:19:_33528.c:835:15: error: expected ')' before 'int'
../include/curses.h:1594:56: note: in definition of macro 'mouse_trafo'
#define mouse_trafo(y,x,to_screen) wmouse_trafo(stdscr,y,x,to_screen)
^
The error message is pointing to the y symbol,
which could be (mis)defined in some header file on your system.
aside from stray #define's, the only interesting thing about the line is that the prototype for wmouse_trafo uses bool, which the configure script should have (given the compiler version used for CLFS) equated to a c99 _Bool (which should not be a problem).
You can see what the compiler sees by doing
make -C ncurses lib_gen.i
and looking for wmouse_trafo in ncurses/lib_gen.i.
For example, I see it mentioned twice:
extern _Bool wmouse_trafo (const WINDOW*, int*, int*, _Bool);
extern _Bool mouse_trafo (int*, int*, _Bool);
and
_Bool (mouse_trafo) (int * a1, int * a2, _Bool z)
{
; return wmouse_trafo(stdscr,a1,a2,z);
}
The stray semicolon is not a problem, but if there were some problem with the cross-compiler it might make the _Bool missing.
The instructions for CLFS 3.0 use gcc 4.8.3 (versions of all of the parts do matter). However, the error message cited here looks like a recent report due to gcc 5 — which is addressed in ncurses 6.0

Problem in Cross-Compiling libSDL for MIPS Platform

I was trying to compile libSDL-1.2.14 for my mips platform.
But it was not successful.
These were the steps that I tried out :
export PATH=/opt/mips-4.3/bin:$PATH
Went inside the libSDL-1.2.14 source folder.
Gave a "./configure --prefix=/usr/local/SDL_Lib --host=mips-linux-gnu"
Executed the "make" command
This was the error received :
cc1: warning: include location
"/usr/include" is unsafe for
cross-compilation
./src/audio/dma/SDL_dmaaudio.c: In
function 'DMA_WaitAudio':
./src/audio/dma/SDL_dmaaudio.c:167:
error: can't find a register in class
'COP3_REGS' while reloading 'asm'
./src/audio/dma/SDL_dmaaudio.c:167:
error: 'asm' operand has impossible
constraints make: *
[build/SDL_dmaaudio.lo] Error 1
But then i reconfigured the make file by giving the following commands :
make clean
./configure --prefix=/usr/local/SDL_Lib --host=mips-linux-gnu CPPFLAGS=-I/opt/mips-4.3/mips-linux-gnu/libc/usr/include/
make
NOTE : /opt/mips-4.3/mips-linux-gnu/libc/usr/include/ - This is the path where you can locate the select.h file for the mips Platform.
It contains the definitions of the macros FD_ZERO and FD_SET.
Still I am getting the same error.
cc1: warning: include location
"/usr/include" is unsafe for
cross-compilation
./src/audio/dma/SDL_dmaaudio.c: In
function 'DMA_WaitAudio':
./src/audio/dma/SDL_dmaaudio.c:167:
error: can't find a register in class
'COP3_REGS' while reloading 'asm'
./src/audio/dma/SDL_dmaaudio.c:167:
error: 'asm' operand has impossible
constraints make: *
[build/SDL_dmaaudio.lo] Error 1
Please help me with some valuable pointers.
Thanks,
Sen
First, don't set the path to the cross-compiler as the first part of your PATH, set it as last:
export PATH=$PATH:<path to cross-compiler>
It's safer this way. Second, run ./configure --help to get all the options. What that error message would say if it was smarter is the following:
You're trying to cross-compile since you're setting the --host flag
But you're not changing any of the other options for where to find includes and libs for the target environment
I'm going to use /usr/include by default
But that's for the host system which will not work when cross-compiling
Check what other configure options you need to set to tell the configure script where to find the .h files (includes) and the libraries for your target. These usually come with the cross-compiler that you download. Also, you should probably set the CROSS_COMPILE environment variable to the cross-compiler prefix before running configure. The prefix is the part before gcc in a cross-compiler, assuming you're using GCC as your cross-compiler.

Resources