How to Compile Openssl for linux-mips32 on a windows machine? - c

I have been struggling to build openssl for linux-mips32 using VS2015x native Tools.
I have set up perl and use the following command to configure:
perl Configure linux-mips32
--prefix=C:\Users\srivaspr\Downloads\openssl-1.0.2k.tar\openssl\builder
--openssldir=C:\Users\srivaspr\Downloads\openssl-1.0.2k.tar\openssl\builder
The configuration command works fine.
But when I use make command it gives the following error:
making all in crypto...
make[1]: Entering directory 'C:/Users/srivaspr/Downloads/openssl-1.0.2k.tar/openssl/crypto'
gcc -I. -I.. -I../include -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -mips2 -mabi=32 -O3 -Wall -DBN_DIV3W -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DAES_ASM -c -o cryptlib.o cryptlib.c
gcc: error: unrecognized argument in option '-mabi=32'
gcc: note: valid arguments to '-mabi=' are: ms sysv
gcc: error: unrecognized command line option '-mips2'
make[1]: *** [<builtin>: cryptlib.o] Error 1
make[1]: Leaving directory 'C:/Users/srivaspr/Downloads/openssl-1.0.2k.tar/openssl/crypto'
make: *** [Makefile:287: build_crypto] Error 1
I have searched through the internet multiple times but could not find anything relevant. Any help would be appreciated.

Related

Building GCC cross-compiler for PowerPC AIX 7.1

I'm just trying to build gcc cross-compiler for AIX7.1. Have successfully built binutils-2.25.1, but have problems with building gcc-6.3.0. It successfully compile target all-gcc but fails on compiling all-target-libgcc. I get this error:
In file included from /home/zakkurasov/aix-sysroot/usr/include/sys/inttypes.h:51:0,
from /home/zakkurasov/cross-aix/build-gcc/gcc/include-fixed/sys/types.h:70,
from /home/zakkurasov/cross-aix/build-gcc/gcc/include-fixed/stdio.h:489,
from ../../../../gcc-6.3.0/libgcc/../gcc/tsystem.h:87,
from ../../../../gcc-6.3.0/libgcc/libgcc2.c:27:
/home/zakkurasov/cross-aix/build-gcc/gcc/include/stdint.h:9:26: fatal error: stdint.h: No such file or directory
# include_next <stdint.h>
^
compilation terminated.
Makefile:467: recipe for target '_lshrdi3.o' failed
make[4]: *** [_lshrdi3.o] Error 1
make[4]: Leaving directory '/home/zakkurasov/cross-aix/build-gcc/powerpc-ibm-aix7.1.0.0/pthread/libgcc'
Makefile:1161: recipe for target 'multi-do' failed
make[3]: *** [multi-do] Error 1
make[3]: Leaving directory '/home/zakkurasov/cross-aix/build-gcc/powerpc-ibm-aix7.1.0.0/libgcc'
Makefile:118: recipe for target 'all-multi' failed
make[2]: *** [all-multi] Error 2
make[2]: Leaving directory '/home/zakkurasov/cross-aix/build-gcc/powerpc-ibm-aix7.1.0.0/libgcc'
Makefile:12321: recipe for target 'all-target-libgcc' failed
make[1]: *** [all-target-libgcc] Error 2
make[1]: Leaving directory '/home/zakkurasov/cross-aix/build-gcc'
Makefile:882: recipe for target 'all' failed
make: *** [all] Error 2
Configure with command:
../gcc-6.3.0/configure --prefix=$PREFIX --host=$MACHTYPE --build=$MACHTYPE --target=$TARGET --with-sysroot=$SYSROOT --with-gnu-as --with-gnu-ld --enable-multilib --enable-languages=c,c++ -v
where
$PREFIX=/opt/aix
$TARGET=powerpc-ibm-aix7.1.0.0
$MACHTYPE=x86_64-pc-linux-gnu
$SYSROOT contain includes and libs from AIX 7.1
Sorry, have checked and saw that files in $SYSROOT/usr just broken symbolic links. Replaced it with files, and get new error:
/home/zakkurasov/cross-aix/build-gcc/./gcc/xgcc -B/home/zakkurasov/cross-aix/build-gcc/./gcc/ -B/opt/aix/powerpc-ibm-aix7.1.0.0/bin/ -B/opt/aix/powerpc-ibm-aix7.1.0.0/lib/ -isystem /opt/aix/powerpc-ibm-aix7.1.0.0/include -isystem /opt/aix/powerpc-ibm-aix7.1.0.0/sys-include -g -O2 -maix64 -O2 -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -mlong-double-128 -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -mlong-double-128 -I. -I. -I../../.././gcc -I../../../../gcc-6.3.0/libgcc -I../../../../gcc-6.3.0/libgcc/. -I../../../../gcc-6.3.0/libgcc/../gcc -I../../../../gcc-6.3.0/libgcc/../include -DHAVE_CC_TLS -DUSE_EMUTLS -o _mulsc3.o -MT _mulsc3.o -MD -MP -MF _mulsc3.dep -DL_mulsc3 -c ../../../../gcc-6.3.0/libgcc/libgcc2.c
/tmp/ccuoaSIc.s: Assembler messages:
/tmp/ccuoaSIc.s:545: Error: junk at end of line: `4'
/tmp/ccuoaSIc.s:548: Error: junk at end of line: `1'
Makefile:467: recipe for target '_mulsc3.o' failed

Building GCC Cross-Compiler on cygwin for PowerPC

I have been trying to build a GCC C language cross-compiler for Powerpc-eabi architecture using Cygwin on Windows 7 32bit.
Following the instructions on http://wiki.osdev.org/GCC_Cross-Compiler when I execute the command
make all-gcc
after a while, the following error is generated.
...
g++ -c-g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual
-Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H
-DGENERATOR_FILE -I. -Ibuild -I../../gcc-5.4.0/gcc
-I../../gcc-5.4.0/gcc/build -I../../gcc-5.4.0/gcc/../include
-I../../gcc-5.4.0/gcc/../libcpp/include
-o build/genpreds.o ../../gcc-5.4.0/gcc/genpreds.c
In file included from ../../gcc-5.4.0/gcc/rtl.h:26:0,
from ../../gcc-5.4.0/gcc/genpreds.c:27:
../../gcc-5.4.0/gcc/real.h:43:35: warning: division by zero [-Wdiv-by-zero]
#define SIGSZ (SIGNIFICAND_BITS / HOST_BITS_PER_LONG)
^
../../gcc-5.4.0/gcc/real.h:56:21: note: in expansion of macro ‘SIGSZ’
unsigned long sig[SIGSZ];
^
../../gcc-5.4.0/gcc/real.h:56:26: error: size of array ‘sig’ is not an integral constant-expression
unsigned long sig[SIGSZ];
^
make[1]: *** [Makefile:2429: build/genpreds.o] Error 1
make[1]: Leaving directory '/home/user/build-gcc/gcc'
make: *** [Makefile:4100: all-gcc] Error 2
The cause of error seems to be the missing definition of HOST_BITS_PER_LONG in file rtl.h.
The configure command is
../gcc-5.4.0/configure --target=powerpc-eabi --prefix=/home/user/opt/cross --disable-nls --enable-languages=c --without-headers
I have binutils-2.26.
Gcc version 5.4.0 is the latest edition available from the Cygwin Package List.
I have also tried using gcc-6.1.0 getting the same error, plus other errors.
I think the configure command was not executed correctly.
Do you have an idea on how to resolve the problem, please?
[1]: http://wiki.osdev.org/GCC_Cross-Compiler

Axis2/c error in instalaltion

My problem is the following one:
When installing Axis2/c under the guidance of http://petio.org/ws/web_services_page7.html , which seems to be an adjusted manual from the official site I have a problem right after executing the make command in terminal.
At exactly this point:
$ cd /tmp/axis/axis2c-src-1.6.0
$ ./configure --prefix=${AXIS2C_HOME} --enable-libxml2=yes
$ make
I get this error:
XXX#XXXPC:~/Tools/axis2c/axis2c-src-1.5.0$ make
make all-recursive
make[1]: Entering directory `/home/XXX/Tools/axis2c/axis2c-src-1.5.0'
Making all in util
make[2]: Entering directory `/home/XXX/Tools/axis2c/axis2c-src-1.5.0/util'
make all-recursive
make[3]: Entering directory `/home/XXX/Tools/axis2c/axis2c-src-1.5.0/util'
Making all in src
make[4]: Entering directory `/home/XXX/Tools/axis2c/axis2c-src-1.5.0/util/src'
Making all in platforms/unix
make[5]: Entering directory `/home/XXX/Tools/axis2c/axis2c-src-1.5.0/util/src/platforms/unix'
/bin/bash ../../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../../include -I../../../include/platforms -I../../../include/platforms/unix -g -O2 -D_LARGEFILE64_SOURCE -ansi -Wall -Werror -Wno-implicit-function-declaration -D_GNU_SOURCE -MT uuid_gen_unix.lo -MD -MP -MF .deps/uuid_gen_unix.Tpo -c -o uuid_gen_unix.lo uuid_gen_unix.c
gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../../include -I../../../include/platforms -I../../../include/platforms/unix -g -O2 -D_LARGEFILE64_SOURCE -ansi -Wall -Werror -Wno-implicit-function-declaration -D_GNU_SOURCE -MT uuid_gen_unix.lo -MD -MP -MF .deps/uuid_gen_unix.Tpo -c uuid_gen_unix.c -fPIC -DPIC -o .libs/uuid_gen_unix.o
**uuid_gen_unix.c: In function ‘axutil_uuid_gen_v1’:
uuid_gen_unix.c:62:20: error: variable ‘tv’ set but not used [-Werror=unused-but-set-variable]**
cc1: all warnings being treated as errors
make[5]: *** [uuid_gen_unix.lo] Error 1
make[5]: Leaving directory `/home/XXX/Tools/axis2c/axis2c-src-1.5.0/util/src/platforms/unix'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/home/XXX/Tools/axis2c/axis2c-src-1.5.0/util/src'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/XXX/Tools/axis2c/axis2c-src-1.5.0/util'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/XXX/Tools/axis2c/axis2c-src-1.5.0/util'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/XXX/Tools/axis2c/axis2c-src-1.5.0'
make: *** [all] Error 2
I am not able to understand the reason why this error is being produced.
Because 1.6.0 version is down, I am using the 1.5.0 source version of axis2/c from the official site : http://axis.apache.org/axis2/c/core/download.cgi .
I have additionally installed Apache2 and libxml2, OpenSSL, cURL, libiconv, and zlib.
libraries.
I need your help because I am trying to build a serious project.
Thanks in advance.
Link to mirror of original Axis2/C-1.6.0 source distribution is here.
The main problem is with -Werror flag.
To compile original Axis2/C with modern compiler you must remove -Werror string from build scripts. To do that run this command after unpacking tarball:
find -type f -name configure -exec sed -i '/CFLAGS/s/-Werror//g' {} \;
Then configure and make Axis2/C.
Note: Original Axis2/C-1.6.0 has many issues like memory leaks and crashes. Consider using Axis2/C unofficial project instead. Most critical Axis2/C-1.6.0's issues is fixed within that project.
Also it have additional features https://code.google.com/p/axis2c-unofficial/wiki/IssuesList like JSON support and enhanced CURL-based transport authentication (and some other features).
There is an manual on how to install Axis2/C unofficial on Linux.

Msys compile of C code

I'm not very familiar with compiling C code, especially on Windows using MinGW/Msys. Here is my problem. I am attempting to compile an open-source M3u8-segmenter C code for Windows. The open-source examples all deal with linux, but I have successfully compiled the code on my Mac OSX machine without a problem.
In Msys on Windows, the ./configure is successful, but once I do the Make, I get the following error. It appears to related to the signal.h include, but I'm not sure. Any insight would be appreciated.
make[1]: Entering directory `/home/install/m3u8-segmenter-master/tests'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/install/m3u8-segmenter-master/tests'
make[1]: Entering directory `/home/install/m3u8-segmenter-master'
gcc -DPACKAGE_NAME=\"m3u8-segmenter\" -DPACKAGE_TARNAME=\"m3u8-segmenter\" -DPAC
KAGE_VERSION=\"0.3\" -DPACKAGE_STRING=\"m3u8-segmenter\ 0.3\" -DPACKAGE_BUGREPOR
T=\"http://github.com/johnf/m3u8-segmenter/issues\" -DPACKAGE_URL=\"http://m3u8-
segmenter.inodes.org\" -DPACKAGE=\"m3u8-segmenter\" -DVERSION=\"0.3\" -DSTDC_HEA
DERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_
H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -
DHAVE_UNISTD_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SIGNAL_H=1 -DHAVE_GETOPT_H=1 -DHAVE
_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_MEMMOVE=1 -DHAVE_MEMSET=1 -DHAVE_STRRCHR=1 -D
HAVE_STRTOL=1 -I. -Ic:/msys/1.0/local/include -g -O2 -Wall -Wextra -Wdeclar
ation-after-statement -Wpointer-arith -funsigned-char -Werror -Wall -Wstrict-pro
totypes -Wmissing-prototypes -Waggregate-return -Wcast-align -Wcast-qual -Wneste
d-externs -Wshadow -Wbad-function-cast -Wwrite-strings -MT m3u8_segmenter-m3u8-
segmenter.o -MD -MP -MF .deps/m3u8_segmenter-m3u8-segmenter.Tpo -c -o m3u8_segme
nter-m3u8-segmenter.o `test -f 'm3u8-segmenter.c' || echo './'`m3u8-segmenter.c
m3u8-segmenter.c: In function 'main':
m3u8-segmenter.c:212:22: error: storage size of 'act' isn't known
m3u8-segmenter.c:413:5: error: implicit declaration of function 'sigaction' [-We
rror=implicit-function-declaration]
m3u8-segmenter.c:413:5: error: nested extern declaration of 'sigaction' [-Werror
=nested-externs]
m3u8-segmenter.c:212:22: error: unused variable 'act' [-Werror=unused-variable]
cc1.exe: all warnings being treated as errors
make[1]: *** [m3u8_segmenter-m3u8-segmenter.o] Error 1
make[1]: Leaving directory `/home/install/m3u8-segmenter-master'
make: *** [all-recursive] Error 1
To emulate UNIX on Windows, Cygwin is more appropriate than MSys/MinGW as pointed by this post

How to build Gotoblas2 on Opensuse 12.2

While building GotoBlas2 on my x86_64 by using the default make file, I encounter the following build error:
gcc -O2 -DEXPRECISION -m128bit-long-double -Wall -m64
-DF_INTERFACE_GFORT -fPIC -DSMP_SERVER -DMAX_CPU_NUMBER=8 -DASMNAME= -DASMFNAME=_ -DNAME=_ -DCNAME= -DCHAR_NAME=\"_\" -DCHAR_CNAME=\"\" -I.. -w -o linktest linktest.c ../libgoto2_nehalemp-r1.13.so -L/usr/lib64/gcc/x86_64-suse-linux/4.7 -L/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/lib
-L/usr/lib64/gcc/x86_64-suse-linux/4.7/../../.. -l -l -lgfortran -lm -lquadmath -lm -lc && echo OK. /usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld:
cannot find -l-l collect2: error: ld returned 1 exit status make[1]:
* [../libgoto2_nehalemp-r1.13.so] Error 1 make[1]: Leaving directory `/home/ken/bin/build/GotoBLAS2/exports' make: * [shared] Error 2
In an attempt to remedy the problem I searched my package manager for a library to satisfy -l-l, looking for things like libl, liblex, libflex, etc but I can't find anything to satisfy the link.
Any ideas?
To fix this, edit line 298 in f_check to
"print MAKEFILE "FEXTRALIB=$linker_L -lgfortran -lm -lquadmath -lm $linker_a\n";"

Resources