Error building GLib - c++

Im trying to build GLib-2.4.0 using the makefile.
I get this error:
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -DG_LOG_DOMAIN=\"GLib\" -DG_DISABLE_CAST_CHECKS -DG_DISABLE_DEPRECATED -DGLIB_COMPILATION -pthreads -g -O2 -Wall -MT gatomic.lo -MD -MP -MF .deps/gatomic.Tpo -c gatomic.c
-fno-common -DPIC -o .libs/gatomic.o
/var/tmp//cctTsmw7.s:103:Incorrect register `%rdx' used with `l' suffix
make[3]: *** [gatomic.lo] Error 1
make[2]: *** [install-recursive] Error 1
make[1]: *** [install-recursive] Error 1
make: *** [install] Error 2
Any ideas?

It's likely that a newer version of glib will fix this problem.
However, if you're stuck with 2.4 for some reason, this was discussed in the gtk-devel-list at http://www.mail-archive.com/gtk-devel-list#gnome.org/msg10924.html ... here is the workaround that was reported there.
Here is the workaround that was successful for two users in that thread:
Ah yes, I think I have stumbled on this as well. This is probably
caused because the default jhbuildrc for the Mac forces a build for
the 486:
When building on intel, force build to be 486, since glib won't
enable asm atomic operations otherwise.
try:
_f = os.popen("uname -p")
if _f.read().startswith("i386"):
append_autogenargs("glib", "--build=i486-apple-darwin")
I changed the last line to:
append_autogenargs("glib", "--build=x86_64-apple-darwin")
And that fixed it for me. (If you have a Mac with a Core2 processor,
the user land will be in 64-bit in Snow Leopard).

Related

c++: error: unrecognized command-line option ‘-target’

Im compiling a program I made using make and I get this error
c++: error: unrecognized command-line option ‘-target’
make[3]: *** [libs/system/CMakeFiles/system.dir/build.make:76: libs/system/CMakeFiles/system.dir/src/system/syscalls.cpp.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:504: libs/system/CMakeFiles/system.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:243: CMakeFiles/image-uefi.dir/rule] Error 2
make: *** [Makefile:137: image-uefi] Error 2
Im running Arch Linux with Clang-13, CMake and all of base-devel installed.
Any help would be appreciated, please dont be condescending I just installed Arch Linux and am getting this error, in Fedora compiling the exact same app provides no error.
The line which created the error is this, it should be the offending linux since the error in question(the top line) complains about -target being unrecognized.
cd /home/user/toy-kernel/build/libs/system && /usr/bin/c++ -I/home/user/toy-kernel/libs/system/src -target x86_64-none-elf -mcmodel=kernel -fno-exceptions -fno-use-cxa-atexit -fno-rtti -nostdlib -ffreestanding -fno-threadsafe-statics -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-sse4.1 -mno-sse4.2 -mno-sse4a -mno-3dnow -mno-3dnowa -std=gnu++20 -MD -MT libs/system/CMakeFiles/system.dir/src/system/syscalls.cpp.o -MF CMakeFiles/system.dir/src/system/syscalls.cpp.o.d -o CMakeFiles/system.dir/src/system/syscalls.cpp.o -c /home/user/toy-kernel/libs/system/src/system/syscalls.cpp
In my case, c++ was the g++ compiler instead of the clang compiler, if you are having a similar issue try updating g++ or clang++(on older macs you may need to have to use brew to install those) or going in your /usr/bin directory(for mac and linux, I never used windows cant help you) and replacing the files(though only do that if you absolutely know what your doing!).

Need Help Upgrading xml-security-c-2.0.2 Getting Fatal Error

I'm trying to upgrade xml-security-c-2.0.2. I extracted the tar file on my linux environment. I exported the following xerces environment variables below before the ./configure command:
Env variables:
export xerces_LIBS=/opt/shibboleth-sp/lib
export xerces_CFLAGS=/opt/shibboleth-sp/include
configure command:
./configure --without-xalan --disable-static --prefix=/opt/shibboleth-sp
Once I run make, I get the following error:
make[2]: Entering directory `/opt/build/xml-security-c-2.0.2/xsec'
g++ -DHAVE_CONFIG_H -I.. -I.. -DXSEC_BUILDING_TOOLS /opt/shibboleth-sp/include -Wall -O2 -DNDEBUG -pthread -MT tools/xtest/xsec_xtest-xtest.o -MD -MP -MF tools/xtest/.deps/xsec_xtest-xtest.Tpo -c -o tools/xtest/xsec_xtest-xtest.o `test -f 'tools/xtest/xtest.cpp' || echo './'`tools/xtest/xtest.cpp
In file included from tools/xtest/xtest.cpp:32:0:
**../xsec/framework/XSECDefs.hpp:63:39: fatal error: xercesc/util/XercesDefs.hpp: No such file or directory
#include <xercesc/util/XercesDefs.hpp>''**'
For whatever reason it cannot find the source file XercesDefs.hpp. This has been an issue for a month or so where we cannot figure out why it isn't finding that source file. When I run a find on this particular file, I get the following path showing it is indeed in multiple locations:
/opt/build/xerces-c-3.2.3/src/xercesc/util/XercesDefs.hpp
/opt/shibboleth-sp/include/xercesc/util/XercesDefs.hpp
Is there something in the compile process that is making this not work or not pick this up? Should I be exporting something else in order to pick up this file?
We currently have version xml-security-c-1.7.3 installed on the machine. Would it be easier to use this version? Is there some sort of bug with 2.0.2 or something that needs to be configured from going from version 1.x to 2.x?
This is all to upgrade shibboleth idp, and installing all the needed dependencies prior to Shibboleth build.
> current OS version Linux version 4.14.214-118.339.amzn1.x86_64
> (gcc version 7.2.1 20170915 (Red Hat 7.2.1-2) (GCC)) #1 SMP
Any help is very much appreciated!
EDIT:
I've exported my CXXFLAGS to point at include however I'm still getting the following error when I issue the make command:
make all-recursive
make[1]: Entering directory `/opt/build/xml-security-c-2.0.2'
Making all in xsec
make[2]: Entering directory `/opt/build/xml-security-c-2.0.2/xsec'
/bin/sh ../libtool --tag=CXX --mode=link g++ /opt/shibboleth-sp/include -Wall /opt/shibboleth-sp/include -O2 -DNDEBUG -pthread -o xsec-xtest tools/xtest/xsec_xtest-xtest.o libxml-security-c.la /opt/shibboleth-sp/lib /opt/apache2_4_46/bin
libtool: link: g++ /opt/shibboleth-sp/include -Wall /opt/shibboleth-sp/include -O2 -DNDEBUG -pthread -o .libs/xsec-xtest tools/xtest/xsec_xtest-xtest.o /opt/shibboleth-sp/lib /opt/apache2_4_46/bin ./.libs/libxml-security-c.so -pthread -Wl,-rpath -Wl,/opt/shibboleth-sp/lib
/opt/shibboleth-sp/include: file not recognized: Is a directory
collect2: error: ld returned 1 exit status
make[2]: *** [xsec-xtest] Error 1
make[2]: Leaving directory `/opt/build/xml-security-c-2.0.2/xsec'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/build/xml-security-c-2.0.2'
make: *** [all] Error 2
What is going on with this?
RHEL 7.2 is the year 2015 update. Current is 7.8 (yum update).
XercesDefs.hpp: No such file
xml-security-c-2.0.2 configure will look in /usr/include, /usr/local/include ! When you have a "hide away" location, the INCLUDE path must be specified : See $ ./configure --help
Example : CXXFLAGS=-I/opt/shibboleth-sp/include , I.e. →
$ ./configure --prefix=/opt/shibboleth-sp CXXFLAGS=-I/opt/shibboleth-sp/include
Bugs : There are no bugs in xml-security-c-2.0.2 . Will compile without errors in EL 7 ( 3 minutes, g++73 (or with the default g++ ver. 4.8 )).
Ref your comment »» I need the .tar.gz files «« : Please follow the link https://ftp.gwdg.de/pub/opensuse/repositories/home%3A/Scott_Cantor/CentOS_7/ → src/
Example $ bash unPack_rpm.sh xml-security-c-2.0.2-4.2.src.rpm and you get xml-security-c-2.0.2-4.2.src/{xml-security-c-2.0.2.tar.bz2 , xml-security-c.spec}
Script unPack_rpm.sh https://drive.google.com/file/d/1q3d9QqrRhEThYByPDgWEaoxHnqWFWqfE/view?usp=sharing
Get build-deps : # yum-builddep xml-security-c.spec

Installing a higiher version of GCC on Raspian Wheezy that doesn't rely on a newer glibc

We have software that we distributed to a bunch of Pis that have Raspian Wheezy. Recently, we've added in a bit of code that uses C++ standards that aren't integrated until >=gcc-4.8. If I compile on a newer version of Raspian, there are glibc mismatch errors when running on the Wheezy installed Pis.
Can I get >=gcc-4.8 on one of the Wheezy Pis without also having to install a higher version of glibc (which automatically makes any binary compiled refuse to work on the other Pis)?
Side note:
I've been trying to compile gcc-4.8 but I'm having the worst time because it keeps throwing a bits/predefs.h is missing error. Even though I configured it with --disable-multilib:
make[3]: Entering directory '/root/gcc-4.8/gcc-4.8-20150611/armv7l-unknown-linux-gnueabihf/libgcc'
# If this is the top-level multilib, build all the other
# multilibs.
/root/gcc-4.8/gcc-4.8-20150611/host-armv7l-unknown-linux-gnueabihf/gcc/xgcc -B/root/gcc-4.8/gcc-4.8-20150611/host-armv7l-unknown-linux-gnueabihf/gcc/ -B/usr/local/armv7l-unknown-linux-gnueabihf/bin/ -B/usr/local/armv7l-unknown-linux-gnueabihf/lib/ -isystem /usr/local/armv7l-unknown-linux-gnueabihf/include -isystem /usr/local/armv7l-unknown-linux-gnueabihf/sys-include -g -O2 -O2 -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -fno-inline -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fPIC -fno-inline -I. -I. -I../../host-armv7l-unknown-linux-gnueabihf/gcc -I../.././libgcc -I../.././libgcc/. -I../.././libgcc/../gcc -I../.././libgcc/../include -DHAVE_CC_TLS -o _muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep -DL_muldi3 -c ../.././libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS
In file included from /usr/include/stdio.h:28:0,
from ../.././libgcc/../gcc/tsystem.h:87,
from ../.././libgcc/libgcc2.c:27:
/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory
#include <bits/predefs.h>
^
compilation terminated.
Makefile:460: recipe for target '_muldi3.o' failed
make[3]: *** [_muldi3.o] Error 1
make[3]: Leaving directory '/root/gcc-4.8/gcc-4.8-20150611/armv7l-unknown-linux-gnueabihf/libgcc'
Makefile:14787: recipe for target 'all-stage1-target-libgcc' failed
make[2]: *** [all-stage1-target-libgcc] Error 2
make[2]: Leaving directory '/root/gcc-4.8/gcc-4.8-20150611'
Makefile:18655: recipe for target 'stage1-bubble' failed
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory '/root/gcc-4.8/gcc-4.8-20150611'
Makefile:884: recipe for target 'all' failed
make: *** [all] Error 2
This article (https://superuser.com/questions/762274/error-compiling-gcc-on-raspberry-pi) doesn't fix my issue unfortunately.

fatal error: mysql.h: No such file or directory

OS: Windows 10
Hello, really hope someone can help as i am desperately trying to install the QMYSQL driver. I am aware that there have been tons of posts about this, but my issue is still not resolved and i really don't know why... My mysql.h file certainly does exist, and thus its path is provided for include. I have latest versions of Qt (5.8 with sources) and MySql (5.7). In mysql installation I chose developer default and installation was successful. I will be happy to provide any further information. I ask for anyone that can help please. Thank you.
in cmd from:
C:\Qt\5.8\Src\qtbase\src\plugins\sqldrivers\mysql
i run:
qmake "INCLUDEPATH+=C:\Program Files\MySQL\MySQL Server 5.7\include" "LIBS+=C:\Program Files\MySQL\MySQL Server 5.7\lib" mysql.pro
then mingw32-make as normal.
i get:
mingw32-make -f Makefile.Release all
mingw32-make[1]: Entering directory 'C:/Qt/5.8/Src/qtbase/src/plugins /sqldrivers/mysql'
g++ -c -pipe -fno-keep-inline-dllexport -O2 -std=c++1z -fno-exceptions -frtti -Wall -Wextra
-Wvla -Wdate-time -DUNICODE -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS
-DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I. -IC:\Program -IFiles\MySQL\MySQL
-IServer -I5.7\include -IC:\Qt\5.8\mingw53_32\include\QtSql\5.8.0 -IC:\Qt\5.8\mingw53_32
\include\QtSql\5.8.0\QtSql -IC:\Qt\5.8\mingw53_32\include\QtCore\5.8.0 -IC:\Qt\5.8\mingw53_32\include\
QtCore\5.8.0\QtCore -IC:\Qt\5.8\mingw53_32\include -IC:\Qt\5.8\mingw53_32\include\QtSql -IC:\Qt\5.8\
mingw53_32\include\QtCore -I.moc\release -IC:\utils\my_sql\my_sql\include -IC:\utils\postgresql
\pgsql\include -IC:\openssl\include -I..\..\..\..\mkspecs\win32-g++ -o .obj\release\qsql_mysql.o qsql_mysql.cpp
In file included from qsql_mysql.cpp:40:0:qsql_mysql_p.h:60:19: fatal error: mysql.h: No such file or directory
compilation terminated.
Makefile.Release:355: recipe for
target '.obj/release/qsql_mysql.o' failed
mingw32-make[1]: *** [.obj/release/qsql_mysql.o] Error 1
mingw32-make[1]: Leaving directory
'C:/Qt/5.8/Src/qtbase/src/plugins /sqldrivers/mysql'
Makefile:38: recipe for target 'release-all' failed
mingw32-make: *** [release-all] Error 2

Cross-compiling kernel module for ARM

I want to cross-compile rtl8192cu driver targeting ARM Angstrom (BeagleBoard), on x86 Ubuntu 13.04.
Cross-compile prerequisites:
rtl8192cu driver
Cross-toolchain (CodeSourcery / arm-angstrom-linux-gnueabi)
kernel sources
For this reason, I copied kernel sources usr/src directory of BeagleBoard, on Ubuntu machine (they heve been compiled on BeagleBoard, as I needed to rebuild the kernel).
Running make for cross-compile, I get this error:
make ARCH=arm CROSS_COMPILE=/home/demetres/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/arm-none-linux-gnueabi- -C /home/demetres/Desktop/ks1 M=/home/demetres/Desktop/rtl3 modules
make[1]: Entering directory `/home/demetres/Desktop/ks1'
CC [M] /home/demetres/Desktop/rtl3/core/rtw_cmd.o
/bin/sh: scripts/basic/fixdep: cannot execute binary file
make[2]: *** [/home/demetres/Desktop/rtl3/core/rtw_cmd.o] Error 126
make[1]: *** [_module_/home/demetres/Desktop/rtl3] Error 2
make[1]: Leaving directory `/home/demetres/Desktop/ks1'
make: *** [modules] Error 2
If I run file fixdep I get:
fixdep: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped
This makes sense, as fixdep, is part of kernel sources (compiled on ARM platform).
My query is: Is that procedure correct and how can I fix this error?
EDIT:
Running make V=1:
make ARCH=arm CROSS_COMPILE=/home/demetres/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/arm-none-linux-gnueabi- -C /home/demetres/Desktop/ks M=/home/demetres/Desktop/rtl modules
make[1]: Entering directory `/home/demetres/Desktop/ks'
test -e include/linux/autoconf.h -a -e include/config/auto.conf || ( \
echo; \
echo " ERROR: Kernel configuration is invalid."; \
echo " include/linux/autoconf.h or include/config/auto.conf are missing."; \
echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; \
echo; \
/bin/false)
mkdir -p /home/demetres/Desktop/rtl/.tmp_versions ; rm -f /home/demetres/Desktop/rtl/.tmp_versions/*
make -f scripts/Makefile.build obj=/home/demetres/Desktop/rtl
/home/demetres/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/arm-none-linux-gnueabi-gcc -Wp,-MD,/home/demetres/Desktop/rtl/core/.rtw_cmd.o.d -nostdinc -isystem /home/demetres/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/../lib/gcc/arm-none-linux-gnueabi/4.7.3/include -Iinclude -I/home/demetres/Desktop/ks/arch/arm/include -include include/linux/autoconf.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-versatile/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -Os -marm -fno-omit-frame-pointer -mapcs -mno-sched-prolog -mabi=apcs-gnu -mno-thumb-interwork -D__LINUX_ARM_ARCH__=5 -march=armv5te -mtune=arm9tdmi -msoft-float -Uarm -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fno-dwarf2-cfi-asm -fconserve-stack -O1 -Wno-unused-variable -Wno-unused-value -Wno-unused-label -Wno-unused-parameter -Wno-unused-function -Wno-unused -Wno-uninitialized -I/home/demetres/Desktop/rtl/include -DCONFIG_POWER_SAVING -DCONFIG_LITTLE_ENDIAN -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(rtw_cmd)" -D"KBUILD_MODNAME=KBUILD_STR(8192cu)" -c -o /home/demetres/Desktop/rtl/core/rtw_cmd.o /home/demetres/Desktop/rtl/core/rtw_cmd.c
/bin/sh: scripts/basic/fixdep: cannot execute binary file
make[2]: *** [/home/demetres/Desktop/rtl/core/rtw_cmd.o] Error 126
make[1]: *** [_module_/home/demetres/Desktop/rtl] Error 2
make[1]: Leaving directory `/home/demetres/Desktop/ks'
make: *** [modules] Error 2
fixdep is an ARM binary and you are trying to run it on x86 machine(intel). You probably have to recompile kernel resources (just make them) and try cross compiling again.