Compiling Bochs 2.4.6 under Cygwin - cygwin

Could anyone tell me a version of Cygwin that can compile successfully Bochs 2.4.6? I've tried with the latest version of Cygwin (1.7.9(0.237/5/3)) but I ran into a bunch of errors.
In specific, I initially got a C compiler cannot create executables error when trying to ./configure Bochs:
...
...
checking if you are configuring for another platform... no
checking for standard CFLAGS on this platform... -mno-cygwin -DWIN32
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/usr/bochs-2.4.6':
configure: error: C compiler cannot create executables
See `config.log' for more details
I solved this by switching my default gcc to version 3.x by using /usr/bin/set-gcc-default-3.sh. However, although the progress of the build was going great, I finally got a DEPRECATED error:
configure: error: DEPRECATED - moved to .bochsrc options
Now, I don't know how to overcome the last error so I am stucked.
Any help will be appreciated.
Thanks a lot.

Related

Linux Centos upgrade glibc 2.12 to 2.14 config error

I am attempting to upgrade 2.12 to 2.14 on Centos and have been following this example: How to upgrade glibc from version 2.12 to 2.14 on CentOS?
All has worked up to ../configure --prefix=/usr/share/doc/glibc-2.14 when I get the output:
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/root/glibc_install/glibc-2.14/build':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
Output of core tests in config.log:
configure:2363: checking build system type
configure:2377: result: x86_64-unknown-linux-gnu
configure:2397: checking host system type
configure:2410: result: x86_64-unknown-linux-gnu
configure:2479: checking for gcc
configure:2509: result: no
configure:2572: checking for cc
configure:2619: result: no
configure:2675: checking for cl.exe
configure:2705: result: no
configure:2729: error: in `/root/glibc_install/glibc-2.14/build':
configure:2731: error: no acceptable C compiler found in $PATH
See `config.log' for more details
Thanks for any help with this :)
It would appear you are missing a C compiler, for example
checking for gcc... no
I would suggest starting with Employed Russian's questions:
Does gcc --version run and report a version number? If no, continue.
Does which gcc give you a path? If no, continue
If either of the above are yes, I would suggest reviewing the contents of your $PATH variable.
If both are no, try:
sudo yum group install "Development Tools"
... with or without sudo, as needed.

Cross compiling gcc 6.2 for QNX

I'm trying to cross compile GCC or clang for qnx and I am not able to find any good set of instructions that explain cross compiling to other operating systems. I already have access to qnx and a GCC compiler version 4.7 for the target.
I've tried reading http://preshing.com/20141119/how-to-build-a-gcc-cross-compiler/ and wasn't successful. I keep running into this error:
checking dynamic linker characteristics... ldqnx.so
checking how to hardcode library paths into programs... immediate
checking for shl_load... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES.
Makefile:11454: recipe for target 'configure-target-libstdc++-v3' failed
make[1]: *** [configure-target-libstdc++-v3] Error 1
I want to compile the latest stable GCC. The host machine is an x86_64 linux. The target is i486-pc-nto-qnx6.6.0. Any ideas?

configure test with static lib

I am trying to cross compile libpng for RaspberryPi on Ubuntu 14.04 (x_64) with zlib
but configure fails with
configure:11400: arm-linux-gnueabihf-gcc -o conftest -g -O2 -I/home/user/RPI_DEV/lib/include conftest.c -lz -lm >&5
/home/user/RPI_DEV/xtools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
configure:11400: $? = 1
configure: failed program was:
....
Because I am using toolchain for arm, arm-ld cant find zlib.
Is there any option for configure not to compile with shared lib but to try with static lib (eg. -static -lz).
Command is
./configure --enable-static=true --enable-shared=false --with-zlib-include="/home/user/RPI_DEV/lib/include" --with-zlib-lib="/home/user/RPI_DEV/lib/lib" LDFLGS="-L/home/user/RPI_DEV/lib/lib" CPPFLAGS="-I/home/user/RPI_DEV/lib/include" -enable-static --host=arm-linux-gnueabihf --prefix=/home/user/RPI_DEV/lib --exec-prefix=/home/user/RPI_DEV/lib
You need to cross build and install zlib into your toolchain before trying to use it in another project.
What you are doing might work but only if you spell LDFLAGS correctly:
LDFLGS="-L/home/user/RPI_DEV/lib/lib"
Note the missing 'A'. I don't know why your second attempt worked, given you had the same misspelling; possibly you had a correct LDFLAGS in your environment?
Anyway there should be a Ubuntu cross-development guide somewhere that explains how to do this. It's slightly off topic but for Gentoo you use 'crossdev' to install the toolchain then a crossdev specific version of the normal package installation mechanism ([host]-emerge) to install zlib into the toolchain.
Also, the arguments --with-zlib-include and --with-zlib-lib are not supported by any current version of libpng I can find. If you are cross-compiling libpng for an RPi (or, indeed, any ARM system) you should be using the latest version of 1.6 that you can find.
Unless someone solves this the RIGHT way, this is hack I've done.
Open configure.ac file
Find and comment out line
AC_CHECK_LIB(z, zlibVersion, , AC_ERROR([zlib not installed]))
Configure will pass wihout check for zlib and then add zlib by hand
LDFLGS="-L/home/user/RPI_DEV/lib/lib -L/home/user/RPI_DEV/lib/lib/libz.a"
Run autoconf
Run ./configure ...

Getting GMP to work with GCC 4.5.2

I'm trying to make a cross compiler with the files from http://crossgcc.rts-software.org/doku.php?id=i386linuxgccformac
I'm on an Intel Mac (10.6.6, x86_64) I compiled: gmp, mpfr, mpc for the cross compiler as 32bit (as I'm on a 64bit Mac) but I'm getting
ld: warning: option -s is obsolete and being ignored
ld: warning: ignoring file /gmp1/lib/libmpc.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: ignoring file /gmp1/lib/libmpfr.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: ignoring file /gmp1/lib/libgmp.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
When compiling GCC with:
--prefix=/usr/local/i386-linux-4.5.2 --target=i386-linux --enable-languages=c --without-headers --disable-shared --disable-threads --disable-nls --with-gmp=/gmp1 --with-gmp-lib=/gmp1 --with-gmp-include=/gmp1 --with-mpfr=/gmp1 --with-mpfr-include=/gmp1 --with-mpfr-lib=/gmp1 --with-mpc=/gmp1 --with-mpc-lib=/gmp1 --with-mpc-include=/gmp1
Also, if I compile GMP with:
./configure --prefix=/gmp1 --host=i386-linux
I get:
configure: WARNING: +----------------------------------------------------------
configure: WARNING: | Cannot determine global symbol prefix.
configure: WARNING: | link -dump -symbols output doesn't contain a global data symbol.
configure: WARNING: | Will proceed with no underscore.
configure: WARNING: | If this is wrong then you'll get link errors referring
configure: WARNING: | to ___gmpn_add_n (note three underscores).
configure: WARNING: | In this case do a fresh build with an override,
configure: WARNING: | ./configure gmp_cv_asm_underscore=yes
configure: WARNING: +----------------------------------------------------------
checking how to switch to read-only data section... .data
checking for assembler .type directive...
checking for assembler .size directive...
checking for assembler local label prefix... configure: WARNING: "link -dump -symbols" failure
configure: WARNING: cannot determine local label, using default L
L
checking for assembler byte directive... .byte
checking how to define a 32-bit word... link: illegal option -- d
I think that you are confused about which package should be compiled for which platform:
GCC needs to be compiled for an x86_64 MacOS X host and an i386-linux target.
GMP, MPC and MPFR are runtime dependencies for GCC. Therefore they also need to be compiled for the GCC host - x86_64 in your case. Therefore, the --host=i386-linux option in the GMP configure command is incorrect.
In general, only libraries that will be linked in the programs compiled by GCC need to be built for the cross-compiler target (e.g. i386-linux). GMP and MPFR are not such libraries, unless your programs are actually using them - in that case you will need to have two copies of such libraries, one for GCC and a cross-build for the target.
EDIT:
Have you considered using MacPorts? It has all the dependencies for your cross-compiler:
gmp-5.0.1
mpfr-3.0.0
libmpc-0.8.2
There is also an older newlib-based cross-compiler for i386:
i386-elf-gcc-4.3.2
Even if you do not want to use these, you can still have a look at the build instructions in their Portfiles.
The bottom line is:
Apply whatever patches these libraries need - MacPorts already do that.
Compile the libraries for your build host i.e. MacOSX/x86_64. That means that in any --host options for their configure calls you should be something along the lines of --host=x86_64-darwin (or whatever your host needs). If configure can figure out the host on its own, you can skip the --host options altogether.
Compile GCC with --host being your build host (the 64-bit Mac OS X) and a target of i386-linux, e.g. --target=i386-linux. If I were you, I'd start simple with a compiler for the C and C++ languages only.
See also this tutorial. It has some information on how to produce a working toolchain with a proper glibc.
That said, I think that you'd be better off installing a proper Linux distribution in a virtual machine, for a whole bunch of reasons. Is there a reason for you to need a cross-compiler specifically? What do you want to do with that compiler?
Did you use the "ABI=32" option when compiling GMP? If not, I think it will use 64-bit code even if the host/target are specified as i386.

Trying to compile slapd on cygwin, what does this automake error mean?

I'm trying to compile a very old verion of slapd (the LDAP server) on cygwin. Previously this ran on a Linux box, but for reasons beyond my control it must be made to work on a Windows server. It has been suggested that we might use cygwin to compile up the source-code.
Unfortunately the build fails during "configure" with the error message:
checking how to run the C preprocessor... cc -E
checking for gcc... (cached) cc
checking whether the C compiler (cc ) works... no
configure: error: installation or configuration problem: C compiler cannot creat
e executables.
The last few lines of config.log are:
configure: failed program was:
#line 2822 "configure"
#include "confdefs.h"
int main() {
return __EMX__;
; return 0; }
configure:2845: checking how to run the C preprocessor
configure:2866: cc -E conftest.c >/dev/null 2>conftest.out
configure:2950: checking for gcc
configure:3063: checking whether the C compiler (cc ) works
configure:3079: cc -o conftest conftest.c 1>&5
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: cannot find
-luser32
collect2: ld returned 1 exit status
configure: failed program was:
#line 3074 "configure"
#include "confdefs.h"
main(){return(0);}
UPDATE: This is a win32 computer - cygwin does not included a shared-object called user32, but Windows XP does include an object called user32.dll - any idea if this might be what the linker is looking for?
UPDATE2: w32api is already installed, (3.13-1) - I note that there is a user32.lib as part of visual-stuido 2003 .Net - is there a way to make GCC in Cygwin use this?
The root cause seems to be
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: cannot find -luser32
This is either a problem with your cygwin installation, or the configure scripts are to old to recognise and handle the installation.
If -luser32 is failing, try installing the w32api Cygwin package.
After much trial & error I found the correct answer for this problem: The reason for this error is that the Cygwin environment was not set up correctly.
The login-user on a domain, and so the /etc/passwd & /etc/group files were not set up correctly by default. The solution was to make a local user-account and then re-build the passwd and groups files.
After that, GCC could build just fine.
Sounds crazy, I know.

Resources