Problems building DBD Sybase on Debian - c

I am trying to build DBD::Sybase on Debian machine, but I am running into a problem. The problem is, BFD (GNU Binutils) 2.21.1 internal error when linking the program. Please help me resolve this.
I successfully installed freetds
Downloaded "DBD-Sybase-1.16"
Executed "perl Makefile.PL INSTALL_BASE=/usr/lib/perl5/" which was successfull
When I execute "sudo make", I get the following error. I tried googling but could not find help.
Here is the tail of the build.
Skip blib/lib/DBD/Sybase.pm (unchanged)
Skip blib/lib/DBD/dbd-sybase.pod (unchanged)
Running Mkbootstrap for DBD::Sybase ()
chmod 644 Sybase.bs
/network/glnxa64/gcc-4.7.2/bin/gcc -c -I/usr/local/freetds/include -DSYB_LP64 -DNO_BLK=1 -I/company/hub/share/apps/BuildTools/Linux/glibc-2.13/x86_64/perl/perl-5.20.2-mw-021/lib/site_perl/5.20.2/x86_64-linux-thread-multi/auto/DBI -D_REENTRANT -D_GNU_SOURCE -O2 -pipe -pthread -fPIC -fwrapv -fno-strict-aliasing -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -DVERSION=\"1.16\" -DXS_VERSION=\"1.16\" -fPIC "-I/company/hub/share/apps/BuildTools/Linux/glibc-2.13/x86_64/perl/perl-5.20.2-mw-021/lib/5.20.2/x86_64-linux-thread-multi/CORE" Sybase.c
/network/glnxa64/gcc-4.7.2/bin/gcc -c -I/usr/local/freetds/include -DSYB_LP64 -DNO_BLK=1 -I/company/hub/share/apps/BuildTools/Linux/glibc-2.13/x86_64/perl/perl-5.20.2-mw-021/lib/site_perl/5.20.2/x86_64-linux-thread-multi/auto/DBI -D_REENTRANT -D_GNU_SOURCE -O2 -pipe -pthread -fPIC -fwrapv -fno-strict-aliasing -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -DVERSION=\"1.16\" -DXS_VERSION=\"1.16\" -fPIC "-I/company/hub/share/apps/BuildTools/Linux/glibc-2.13/x86_64/perl/perl-5.20.2-mw-021/lib/5.20.2/x86_64-linux-thread-multi/CORE" dbdimp.c
rm -f blib/arch/auto/DBD/Sybase/Sybase.so
LD_RUN_PATH="/usr/local/freetds/lib" /network/glnxa64/gcc-4.7.2/bin/gcc -shared -L/usr/local/freetds/lib -pthread -L/usr/local/lib -fstack-protector Sybase.o dbdimp.o -o blib/arch/auto/DBD/Sybase/Sybase.so \
-L/usr/local/freetds/lib -lct -ldl -lm \
/network/glnxa64/gcc-4.7.2/bin/ld: BFD (GNU Binutils) 2.21.1 internal error, aborting at /local/greg/3p/sources/gcc-4.7/../binutils/bfd/reloc.c line 443 in bfd_get_reloc_size
/network/glnxa64/gcc-4.7.2/bin/ld: Please report this bug.
collect2: error: ld returned 1 exit status
Makefile:485: recipe for target 'blib/arch/auto/DBD/Sybase/Sybase.so' failed
make: *** [blib/arch/auto/DBD/Sybase/Sybase.so] Error 1

As #jww pointed out, the issue was the older version of binutils and gcc. I just edited the generated Makefile in Sybase base directory to point to newer versions of gcc and binutils. FYI, I the versions that worked are "gcc version 6.3.0 " and "GNU ld (GNU Binutils) 2.28.1"

Related

Error 2: The system cannot find the file specified. "Cygwin Make"

I have a project with a makefile, linker file and some other c files. Whenever i try to run the make command from my windows. i end up with this error. I am using a cygwin terminal. The project was initially used Linux environment.
process_begin: CreateProcess(NULL, arm-none-eabi-gcc -c -g -Os -I. -fno-common -
ffunction-sections -ffreestanding -fno-builtin -mthumb -mcpu=cortex-m7 -specs=na
no.specs -Wall -Winline -fstack-usage -DSTM32F769xx -mfloat-abi=hard -mfpu=fpv5-
d16 -fno-strict-aliasing -Wno-discarded-qualifiers stm32init.c -o stm32init.o, .
..) failed.
make (e=2): The system cannot find the file specified.
make: *** [makefile:20: stm32init.o] Error 2
Let me know how i can fix this problem.

installed check for c but "check.h" not found

Im using windows 10 with wsl ubuntu 18.04 Im trying to run the code from here :
https://www.ccs.neu.edu/home/skotthe/classes/cs5600/fall/2015/labs/intro-check-lab-code.tgz
I installed gcc, makefile, and check in the ubuntu terminal. But when I di $ make it says:
gcc money.o check_money.o -lcheck -lm -lpthread -lrt -lgcov -coverage -o check_money_tests
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libcheck.a(check_log.o): In function `subunit_lfun':
(.text+0x5f4): undefined reference to `subunit_test_start'
(.text+0x6bf): undefined reference to `subunit_test_fail'
(.text+0x6d4): undefined reference to `subunit_test_pass'
(.text+0x6ef): undefined reference to `subunit_test_error'
collect2: error: ld returned 1 exit status
Makefile:23: recipe for target 'check_money_tests' failed
make: *** [check_money_tests] Error 1
so I open the check_money.c it says that check.h cannot be found. What did I miss here?
Simple version: you should also link with -lsubunit flag, i.e.:
TST_LIBS = -lcheck -lm -lpthread -lrt -lsubunit
Better yet, all the flags should be taken from check's package configuration, as the requirements depend on how the check library was built (and that's what pkg-config has been invented for). So instead of hardcoding your options, you could improve your Makefile like this:
CFLAGS = -c -Wall $(shell pkg-config --cflags check)
TST_LIBS = $(shell pkg-config --libs check)
Result:
$ make
gcc -c -Wall -pthread -fprofile-arcs -ftest-coverage src/*.c
gcc -c -Wall -pthread -fprofile-arcs -ftest-coverage tests/*.c
gcc money.o check_money.o -lcheck_pic -pthread -lrt -lm -lsubunit -lgcov -coverage -o check_money_tests
...

QT5.7 Cross compile for AM1808 ARM9

Currently, we are working on QT for application development for our hardware that runs on the AM1808 processor.
At present, we developed our app using QT creator with compiler version Qt 4.8.7.
We are planning to upgrade it with Qt 5.7 and for that, we download the corresponding package from
http://download.qt.io/official_releases/qt/5.7/5.7.1/single/qt-everywhere-opensource-src-5.7.1.tar.gz
We successfully download this and now need to configure according to our current arm toolchain.
we have modified the qmake.conf as per below,
#
# qmake configuration for building with arm-linux-gnueabi-g++
#
MAKEFILE_GENERATOR = UNIX
CONFIG += incremental
QMAKE_INCREMENTAL_STYLE = sublib
include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)
// modifications to g++.conf
//QMAKE_CC = arm-linux-gnueabi-gcc
//QMAKE_CXX = arm-linux-gnueabi-g++
//QMAKE_LINK = arm-linux-gnueabi-g++
//QMAKE_LINK_SHLIB = arm-linux-gnueabi-g++
// modifications to linux.conf
//QMAKE_AR = arm-linux-gnueabi-ar cqs
//QMAKE_OBJCOPY = arm-linux-gnueabi-objcopy
//QMAKE_NM = arm-linux-gnueabi-nm -P
//QMAKE_STRIP = arm-linux-gnueabi-strip
QMAKE_CC = arm-none-linux-gnueabi-gcc
QMAKE_CXX = arm-none-linux-gnueabi-g++
QMAKE_LINK = arm-none-linux-gnueabi-g++
QMAKE_LINK_SHLIB = arm-none-linux-gnueabi-g++
QMAKE_AR = arm-none-linux-gnueabi-ar cqs
QMAKE_OBJCOPY = arm-none-linux-gnueabi-objcopy
QMAKE_STRIP = arm-none-linux-gnueabi-strip
load(qt_config)
after that, we run config command
./configure -opensource -confirm-license -prefix /usr/local/Qt5 -no-pch -xplatform linux-arm-gnueabi-g++
but we found the following error,
System architecture: 'arm'
Host architecture: 'i386'
arm-none-linux-gnueabi-g++ -c -fvisibility=hidden fvisibility.c
Symbol visibility control enabled.
cc1plus: error: unrecognized command line option '-fuse-ld=gold'
arm-none-linux-gnueabi-g++ -o libtest.so -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c
bsymbolic_functions.c:2:2: error: #error "Symbolic function binding on this architecture may be broken, disabling it (see QTBUG-36129)."
Symbolic function binding disabled.
checking for C++14...
arm-none-linux-gnueabi-g++ -c -pipe -O2 -std=gnu++1y -Wall -W -fPIC -I. -I../../../mkspecs/linux-arm-gnueabi-g++ -o c++14.o c++14.cpp
cc1plus: error: unrecognized command line option '-std=gnu++1y'
make: *** [c++14.o] Error 1
C++14 disabled.
checking for default C++ standard edition...
arm-none-linux-gnueabi-g++ -pipe -O2 -Wall -W -fPIC -I. -I../../../mkspecs/linux-arm-gnueabi-g++ -o c++default.ii -E c++default.cpp
default C++ standard edition enabled.
checking for 64-bit std::atomic...
arm-none-linux-gnueabi-g++ -c -pipe -O2 -std=gnu++11 -Wall -W -fPIC -I. -I../../../mkspecs/linux-arm-gnueabi-g++ -o atomic64.o atomic64.cpp
cc1plus: error: unrecognized command line option '-std=gnu++11'
make: *** [atomic64.o] Error 1
64-bit std::atomic disabled.
checking for 64-bit std::atomic in -latomic...
arm-none-linux-gnueabi-g++ -c -pipe -O2 -std=gnu++11 -Wall -W -fPIC -I. -I../../../mkspecs/linux-arm-gnueabi-g++ -o atomic64.o atomic64.cpp
cc1plus: error: unrecognized command line option '-std=gnu++11'
make: *** [atomic64.o] Error 1
64-bit std::atomic in -latomic disabled.
checking for std::atomic for function pointers...
arm-none-linux-gnueabi-g++ -c -pipe -O2 -std=gnu++11 -Wall -W -fPIC -I. -I../../../mkspecs/linux-arm-gnueabi-g++ -o atomicfptr.o atomicfptr.cpp
cc1plus: error: unrecognized command line option '-std=gnu++11'
make: *** [atomicfptr.o] Error 1
std::atomic for function pointers disabled.
ERROR: detected a std::atomic implementation that fails for function pointers.
Please apply the patch corresponding to your Standard Library vendor, found in
/opt/qt-everywhere-opensource-src-5.7.1/qtbase/config.tests/common/atomicfptr
so, please suggest us correct method to compile this qt5 version.
Your toolchain is too old. Qt 5.6 was the last release which doesn't require a more or less fully C++ 11 compliant compiler. This changed with Qt 5.7.
Either upgrade your toolchain to 4.8 (at least) or try Qt 5.6.

gcc won't include libcurl on commandline for OS X

I'm trying to compile a C project I've been working on on a remote server that runs OS X. The project depends, in part, on libcurl. I only have access to the machine through my administrator account remotely.
When I attempt to make the project I keep getting errors relating to libcurl functions and constants not being defined. I conclude that libcurl is not being properly included by the compiler.
I'm using fink to install opensource software for all the dependencies ( postgres, curl, a few others ) and all the dependencies appear to work except curl.
My compiler command looks like:
gcc -ggdb -ansi -Wall -D_GNU_SOURCE -L `/sw/bin/pg_config --libdir` `/sw/bin/curl-config --cflags` -I `/sw/bin/pg_config --includedir` -lpq -lcurl -lpthread -lm `/sw/bin/curl-config --libs` -c Client.c
If I make a test file like so:
/sw/bin/curl http://www.google.com/ --libcurl test.c
And then attempt to compile it with:
gcc test.c `/sw/bin/curl-config --cflags` `/sw/bin/curl-config --libs` -o test.o
It also fails. Can anyone help me shed some light on this problem?
One compilation line is:
gcc -ggdb -ansi -Wall -D_GNU_SOURCE -L `/sw/bin/pg_config --libdir` \
`/sw/bin/curl-config --cflags` -I `/sw/bin/pg_config --includedir` \
-lpq -lcurl -lpthread -lm `/sw/bin/curl-config --libs` -c Client.c
This will take Client.c and generate Client.o, an object file. It doesn't need the library information; there is no linking taking place because of the -c option.
The other compilation line is:
gcc test.c `/sw/bin/curl-config --cflags` `/sw/bin/curl-config --libs` -o test.o
It is aconventional to end the names of executables with '.o'; it leads to confusion. However, if test.c only references functions from the standard libraries and libcurl, it should 'work'.
On my Mac, there is a copy of curl-config in /usr/bin.
Try this test program:
$ cat curltest.c
#include <stdio.h>
#include <curl/curl.h>
int main(void)
{
if (curl_global_init(0) == CURLE_OK)
{
printf("CURL version %s\n", curl_version());
curl_global_cleanup();
}
else
fprintf(stderr, "Failed to initialize CURL\n");
return 0;
}
$ cc -o curltest $(curl-config --cflags) curltest.c $(curl-config --libs)
$ file curltest
curltest: Mach-O 64-bit executable x86_64
$ otool -L curltest
curltest:
/usr/lib/libcurl.4.dylib (compatibility version 6.0.0, current version 6.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)
$ curltest
CURL version libcurl/7.19.7 OpenSSL/0.9.8r zlib/1.2.3
$
This is on MacOS X 10.6.8.

Nokogiri Compilation Error - Can't find libraries/headers

Trying to install a gem, but it can't find the headers, despite specifying them:
sudo gem install nokogiri -- --with-xml2-lib=/usr/local/lib --with-xml2-include=/usr/local/include/libxml2 --with-xml2-include=/usr/local/include/libxml2 --with-xslt-include=/usr/local/include/libxslt
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb --with-xml2-lib=/usr/local/lib --with-xml2-include=/usr/local/include/libxml2 --with-xml2-include=/usr/local/include/libxml2 --with-xslt-include=/usr/local/include/libxslt
checking for #include <libxml/parser.h>
... no
-----
libxml2 is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
The /usr/local/include/libxml2/libxml/parser.h file does exist, so I don't see why this isn't working.
EDIT: I'm on Centos 5.4
If you dig into /usr/lib/ruby/1.8/mkmf.rb you can figure out how to simulate the check that's happening during install. In my case I could do this by creating a file called conftest.c containing:
#include <libxml/parser.h>
Then try running the command that gets passed into the try_do function. In my case this was:
gcc -E -I. -I/usr/lib64/ruby/1.8/x86_64-linux -I. -I-I-I/opt/local/include -I-I-I/usr/local/include -I-I-I/usr/include -I-I-I/usr/include -I-I-I/usr/include/libxml2 -I/opt/local/include/libxml2 -I/usr/local/include/libxml2 -I-I/opt/local/include -I-I/usr/local/include -I-I/usr/include -I-I/usr/include -I-I/usr/include/libxml2 -I/opt/local/include -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include/libxml2 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -fPIC -g -DXP_UNIX -O3 -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline conftest.c -o conftest.i
In my case I was missing gcc, which is probably not what you're hitting since you said you compiled from source. But hopefully if you run this command it should give you an idea of why you can't load in libxml2.
If you're interested in pre-built apparently EPEL has a rubygems-nokogiri package. Good chance I'll go this route in the end.

Resources