32 bit builds on 64 bit CentOS 5 hosts - gcc

I am trying to build valgrind (3.7.0) on a 64 bit host (running CentOS 5.8). I need to use valgrind in examining the performance of a 32 bit program (built on a 32 bit host, I need 32 bit because the program needs to run on 32 bit and 64 bit hosts).
The problem is that my 64 bit host did not have gcc, so I installed gcc using "sudo yum install gcc" with the Stanford University repo mirror (the default repos for this 64 bit host were unavailable and thus yum was timing out). This allowed me to build valgrind, and it worked for local stuff (e.g. "valgrind ls -l"), but failed when trying to run it for the 32 bit program I have built on another host. I finally figured out that the configure script for valgrind was detecting that I did not have 32 bit build support on the host (by running "configure --enable-only32bit" which reported "checking for 32 bit build support... no").
So how do I get 32 bit support for gcc, etc? I tried "yum search gcc | grep i386" and then installing whatever looked like 32 bit C stuff ("sudo yum install compat-glibc.i386 compat-libgcc-296.i386 compat-libstdc++-296.i386 compat-libstdc++-33.i386 libgcc.i386 libstdc++.i386 libstdc++-devel.i386 libstdc++44-devel.i386 edac-utils.i386 edac-utils.x86_64 nspluginwrapper.i386") but "configure --enable-only32bit" still reports no 32 bit support.
PS: The yum.conf looks pretty minimal, i.e. no excludes. The only odd thing in it is "installonly_limit = 5"
OK, here is the scoop, thanks to Error "gnu/stubs-32.h: No such file or directory" while compiling Nachos source code
The short answer is to install glibc-devel.i386 (on CentOS 5.8 anyway... for different distros it has different names, e.g. glibc-devel.i686, libc6-dev-i386, etc), possibly in addition to the other packages I listed above (I did not uninstall those to see if glibc-devel.i386 was sufficient by itself).
I arrived at the right question to search for by examining the configure script and seeing that it tries to compile a minimal C program with "-m32" and if that fails then the configure script reports "no 32 bit support". So I created the classic HelloWorld C program and compiled it ("cc -m32 hello.c"). This complained of a missing header file "gnu/stubs-32.h". So a google search on "what package has gnu/stubs-32.h" took me to the stackoverflow page I cite above.

Try:
yum install glibc-devel.i686
if this doesn't work then check this solution: How to compile a 32-bit binary on a 64-bit linux machine with gcc/cmake

Related

How do we install gcc-go to AIX machine power-pc-7 bigendian 64 bit?

I have a AIX machine which runs on power-pc-7 bigendian 64 bit I understand installing Go compiler is easy for Windows,Linux and Mac but if we want to install it on AIX then it involves different steps.
I downloaded the tar file supported for my AIX machine "go1.14.1.linux-pcc64le.tar.gz" using the link "https://dl.google.com/go/go.1.14.1.linux-pcc64le.tar.gz" after downloading this not sure how to proceed also I am using the littleendian one as I didn't any reference for bigendian .
All I wanted to do first before i start my project is to run a hello world Go program on my AIX machine does anyone have any idea on this ?
A little-endian program will not work on a big-endian operating system and vice-versa.
Two alternatives:
Download golang from http://www.bullfreeware.com/?searching=true&package=golang&from=&to=&libraries=false&exact=false&version=5 but they only have go v1.14 and it only works on AIX 7.2.
Download the source and follow the instructions on https://golang.org/doc/install/source -- it's not trivial as go is written in go nowadays, so you need to install go 1.4 first.

Error go build using gcc on windows

I'm working on hyperledger fabric sdk client on my computer which is running on Windows 10 64 bits but my problem is general with Go.
In order to do the go build command on my .go file, I had to install gcc. So I installed cygwin 64 bits for Windows.
In the bin repository, I had 3 differents .exe for gcc. I tried all of them :
gcc.exe : I have an error because this .exe is for windows 32 bits and go is 64 bits
x86_64-w64-mingw32-gcc.exe : I have an error, this .exe isn't able to find -lltdl
x86_64-pc-cygwin-gcc : This .exe isn't able to find -lmingwex and -lmingw32
The solution proposed on some subject was to install TDM-GCC-64, but when I do that, I have an error : ltdl.h not found
So if anyone have any idea in order to solve this issue, it will be great !
Thank you :)
PS : Sorry for my english
You're jumping to conclusions without thinking. Windows X64 has full support for 32-bit .exe, but of course you must avoid trying to mix 32-bit and 64-bit applications. You will need to look up how to install libtool or libltdl (.dll and .h) corresponding to whichever gcc version you end up choosing. It's unclear on the cygwin web page whether that is supported for cygwin64. Also, you may need to think about whether you want cygwin gcc and go or a mingw version.

How to compile libdp.dll as 64 bit architecture on windows

I'm trying to build libpd on windows https://github.com/libpd/libpd
The problem I'm having is that when I build with the given "mingw_build.bat" - the libpd.dll that is built is 32 bit architecture.
How can I build using MingW so my resulting DLL is 64 bit architecture?
afaict there is no ready-made solution for this.
here are some generic hints (haven't tried them):
you would need to install mingw64 (the mingw_build.bat seems to assume that you are using mingw32)
fix the paths in mingw_build.bat
additionally set the C-compiler to one that produces 64bit binaries:
CC=x86_64-w64-mingw32-gcc

install libssh2.dll on windows

I want to install SSH on my PC (windows 7 64bits).
But I have a problem with the installation of libssh2.dll file
I saved in: C: \ Windows \ SysWOW64
and even in C: \ Windows \ System32
and when I execute this command "regsvr32 libssh2.dll" in cmd as administrator I get this error message:
Libssh2.dll "The module" "was loaded, but the DllRegisterServer entry point was not found.
Verify that "libssh2.dll" is a valid DLL or OCX file and try again. "
I downloaded from this site file:
http://windows.php.net/downloads/pecl/releases/ssh2/0.12/
The only good that contains the libssh2.dll is x86 (knowing that I have a 64bits), is what may be causing the problem?
If someone knows a solution, please, share it, it is very important that I find a solution as soon as possible and thank you.
You have to put that libssh2.dll somewhere on the %path% so then the PHP extension can find it. Logic were to put it into your PHP dir (if you use the standard zipball from windows.php.net).
well why have you downloaded a 32 bit file to a 64 bit system
am I missing something here
You can only run a 32bit type if your Apache PHP and MySQL have 32bit running versions or 64 bit in your case. So if you are running a 32bit OS on a 64bit system then this is fine, if you are running 64 bit script on a 64 bit system and are trying to use a 32 bit script which I suspect you are then this is not fine!
I would therefore suggest that if this is the case you may have a mix match of OS Versus Script.
There are a few brave people operating in the 64 bit world and you should only ever use the stable versions of the product and like Apache unless you do you will not get the support you want because you have not utilised a stable version only and Apache will not support 64 bit, hence Apache lounge.
If you are running off localhost or 127.0.0.1, then running a stable 32 bit OS and running the 32 bit stable version is the only way you will get support.

32-bit Fortran on 64-bit Server

I have a 32-bit Fortran application that I need to run on a 64-bit ubuntu server. I have verified the application on a 32-bit ubuntu machine and it runs fine; however, I get the following error when I run in on the 64-bit server:
error while loading shared libraries: libgfortran.so.3: cannot open shared object file: No such file or directory
Doing some research on this, I've tried the following with no joy:
sudo apt-get install libgfortran3:i386 which can't locate the package
Manually install a 32-bit .deb package of libgfortran (failed with
error about incorrect architecture)
Install getlibs and have it determine what the dependencies are
Run ldconfig -v which finds libgfortran.so.3 -> libgfortran.so.3.0.0 under /usr/lib/x86_64-linux-gnu:...
... and then try to change the path to LD_LIBRARY_PATH to that, which did nothing (though I have to say that my knowledge gets very sparce once we start talking about library paths...)
Check if ia32-libs are installed, which they are
removed and re-installed libgfortran, then randpkg --configure --pending and dpkg --path-include=/usr/lib/x86_64-linux-gnu.
I'd like to stay away from creating a 32-bit chroot if at all possible but at this point I don't if there is anything else to do that could keep me from having to do so...
Do any of you have an idea as to something else I could do? Thank you.
Try to install the package lib32gfortran3, as that would install the 32 bit version of the libgfortran library. Before starting the program, you may eventually need to set LD_LIBRARY_PATH="/usr/lib32:" but probably it will run also without this.
I'm not sure if this was an oversight on my part or something else; but here are the two steps that fixed it all:
Run sudo apt-get install gfortran on a 64-bit machine which will install the GNU Fortran Compiler
Recompile the application, on the 64-bit machine, using gfortran.
The strange part was that at this point I was still not able to just copy/paste the application file to other 64-bit machines and run it. Rather, I first had to separately install gfortran on each machine, even if I wasn't planning on compiling anything. Once gfortran was installed, the application would run, no matter where it was compiled... I presume that the libgfortran3 must have been some dependency...

Resources