Trying to build binutils with --enable-gold - binutils

Following instructions from this site: http://llvm.org/docs/GoldPlugin.html
From the command:
../binutils/configure --enable-gold --enable-plugins --disable-werror
I get a warning saying:
configure: WARNING: unrecognized options: --enable-gold
From this point, I can't continue building the project. Any advise?

Are you sure that you are in a sibling folder of binutils? I copied the command from the instructions but forgot that I was in a different directory and picked up a different configure script.

Related

How to fix meson generating an incorrect linker flag (--subsystem console)

I've created a simple project to get myself accustomed to meson, but the build keeps failing.
This is what I did (to set up the environment, and to build):
set CC=clang
set CC_LD=lld
set CFLAGS="--target x86_64-pc-windows-msvc"
meson build
cd build
ninja
My meson.build is as follows:
project('EtaClient', 'c')
src = ['src/main.c', 'src/linkedlist.c']
executable('EtaClient', src)
target = 'x86_64-pc-windows-msvc'
While building, I get the following errors (the obj files are built successfully, but they're not linked and thus the exe isn't built):
LINK : warning LNK4044: unrecognized option '/-subsystem'; ignored
LINK : fatal error LNK1181: cannot open input file 'console.obj'
clang: error: linker command failed with exit code 1181 (use -v to see invocation)
When I look in my build.ninja to see what's going on, I find:
build EtaClient.exe | EtaClient.pdb: c_LINKER EtaClient.exe.p/src_main.c.obj EtaClient.exe.p/src_linkedlist.c.obj
LINK_ARGS = "-Wl,/nologo" "-Wl,/release" "-Wl,/nologo" "-Wl,/DEBUG" "-Wl,/PDB:EtaClient.pdb" "-Wl,--subsystem,console" "-lkernel32" "-luser32" "-lgdi32" "-lwinspool" "-lshell32" "-lole32" "-loleaut32" "-luuid" "-lcomdlg32" "-ladvapi32"
I replace "-Wl,--subsystem,console" with "-Wl,/subsystem:console", and the build compiles successfully, but I have to manually make this edit each time I modify my meson.build.
Could someone tell me why this happens, and how to set up meson to generate the correct flag?
Thanks in advance.
use clang-cl instead of clang and leave out the defintion of the linker when you are on windows
set CC=clang-cl
set CFLAGS="--target x86_64-pc-windows-msvc"
meson build
cd build
ninja
see
https://github.com/mesonbuild/meson/issues/4232

build_iphone.sh: line 52: /Users/.../pocketsphinx-master/configure: No such file or directory

I'm on macOS Mojave in terminal, and I'm getting an error that says no such file or directory for the directory ".../pocketsphinx-master/configure" when I run build_iphone.sh, which I got from this repository: cmusphinx/pocketsphinx-ios-demo.
The instructions for pocketsphinx found at this repository -- cmusphinx/pocketsphinx gives these instructions to use pocketsphinx with Xcode. Here's part of what it says, which I don't understand:
Pocketsphinx uses the standard unix autogen system, you can build pocketsphinx with automake given you already built sphinxbase You just need to pass correct configure arguments, set compiler path, set sysroot and other options. After you build the code you need to import dylib file into your project and you also need to configure includes for your project to find sphinxbase headers.
Here is what my terminal on my Mac mini looks like:
Daniels-Mac-mini:pocketsphinx-master shinehah$ sh build_iphone.sh
building arm64...
build_iphone.sh: line 52: /Users/shinehah/cmusphinx/pocketsphinx-master/configure: No such file or directory
I created that directory, but I still get the same error message. What do I need to put in that directory?
In build_iphone.sh, line 52, it says:
--host="${HOST_TYPE}" \
Here is the code segment it is from:
$CWD/configure
--host="${HOST_TYPE}" // line 52
--prefix="$DEST/$ARCH"
--without-lapack
--without-python
--with-sphinxbase="$SPHINXBASE_DIR"
|| exit 1

build alljoyn_darwin in Xcode 6.1.1 and get a No SConstruct file found error

Recently I am doing some AllJoyn development on iOS and OS X. When I run xcodebuild for alljoyn_darwin.xcodeproj using command line as below:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project alljoyn_darwin.xcodeproj -scheme alljoyn_core_ios -sdk iphoneos -configuration Debug PLATFORM_NAME=iphoneos
I got an error like this:
export variant=normal
/opt/local/bin/scons -u OS=darwin CPU=arm BR=on BINDINGS=cpp SERVICES= WS=off VARIANT=Debug --
scons: *** No SConstruct file found.
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/scons-2.3.4/SCons/Script/Main.py", line 920, in _main
Command /opt/local/bin/scons failed with exit code 2
** BUILD FAILED **
The following build commands failed:
ExternalBuildToolExecution alljoyn_core_ios
(1 failure)
I really have no idea why I got this, I followed all the instruction in the official site--Build From Source and I am sure I set the correct OPENSSL_ROOT path. I installed scons using Macport and it was installed correctly. I tried double-click the alljoyn_darwin.xcodeproj from finder but I got the same error.
scons: *** No SConstruct file found.
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/scons-2.3.4/SCons/Script/Main.py", line 920, in _main
Command /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/scons-2.3.4 failed with exit code 2
So I am stuck here. But the thing is I can successfully run AllChatz sample in sdk_14.12 for iOS in iphonesimulator for iPhone6. openssl version is 1.0.2 and I tried build both for alljoyn sdks 14.06 and 14.12. same error happened. I don't know if this is related. Anyone can help here? Many thanks.
The problem is that scons cant find the root-level SConstruct script, which probably doesnt help much as you can see that in the error :)
When you use the "-u", that tells scons to look up the directory structure for the root-level SConstruct script.
SCons must be executed from within the project directory structure. Look for the root-level SConstruct, and make sure you're executing scons from within the project directory structure.

compile vlc for android

I am trying to compile vlc for android in RHEL 6.4 (Santiago). I am following the instructions given in this page https://wiki.videolan.org/AndroidCompile. I am getting some errors.
First is when I build this, I get error in git.
error: unknown switch `B'. refer http://txt.do/6tjh for log
I changed the git checkout -B android ${TESTED_HASH} to git checkout -b android ${TESTED_HASH}. Then this error does not come
Then when I run sh compile.sh, I get following errors (refer http://tny.cz/bb552912 I have removed some part of log which had code to download packages like automake, protobuf, ragel etc)
rmdir: failed to remove /root/Documents/android/android/vlc/contrib/arm-linux-androideabi/include/freetype2/freetype/config': No such file or directory
make[1]: [install] Error 1 (ignored)
rmdir: failed to remove `/root/Documents/android/android/vlc/contrib/arm-linux-androideabi/include/freetype2/freetype': No such file or directory
make[1]: [install] Error 1 (ignored)
Then if I again run sh compile.sh, weird things happen. I don't get this error again, but it builds some library and then stops.
First it build libdvdcss and then stops (refer http://tny.cz/5f3ab58f)
It ends like
Libraries have been installed in:
/root/Documents/android/android/vlc/contrib/arm-linux-androideabi/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following:
add LIBDIR to the `LD_LIBRARY_PATH' environment variable during execution
add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
use the `-Wl,-rpath -Wl,LIBDIR' linker flag
have your system administrator add LIBDIR to `/etc/ld.so.conf'
make[2]: Leaving directory `/root/Documents/android/android/vlc/contrib/contrib-android-arm-linux-androideabi/dvdcss'
make[1]: Leaving directory `/root/Documents/android/android/vlc/contrib/contrib-android-arm-linux-androideabi/dvdcss'
touch .dvdcss
Then each time I run "sh compile.sh" it build one more library and then stops.
it has build following libraries
libopenjpeg (http://tny.cz/86236e8b)
libgpg-error http://tny.cz/26c5626b)
ffmpeg (http://tny.cz/1f05aa0f)
gmp
libgcrypt
iconv
nettle
libjpeg
Finally I get an following error and I am not able to do any after that (http://tny.cz/ed7798ea)
autopoint: * The AM_GNU_GETTEXT_VERSION declaration in your configure.ac file requires the infrastructure from gettext-0.18 but this version is older. Please upgrade to gettext-0.18 or newer.
autopoint: * Stop.
autoreconf: autopoint failed with exit status: 1
configure.in:20: error: possibly undefined macro: AM_PROG_LIBTOOL
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
autoreconf: /root/Documents/android/android/vlc/extras/tools/build/bin/autoconf failed with exit status: 1
make: *[.ogg] Error 1
I am not able to find gettext package with version > .18 for RHEL 6.4. Maximum available is .17 which is installed
Is not this weird. Should not doing "sh compile.sh" build all libraries and I should not have to do this again and again.
Also Is RHEL 6.4 (Santiago) compatible for building vlc android
Any help for these errors

Library not found for -llib. (clang: error: linker command failed with exit code 1 (use -v to see invocation))

I am working on a project that was previously done and uploaded on app store.When I run this app in Xcode 5.0 it is working fine but when I run this on Xcode Version 5.1.1 (5B1008) I am getting Linker error on both device and simulator.
Error Message- Library not found for -llib. (clang: error: linker command failed with exit code 1 (use -v to see invocation)).
I have searched a lot but I didn't get any thread about Library not found for -llib error. Is there anything I have to change in build settings to resolve this?
Look at the linker command line in detail for the -L options being used:
Then use Terminal or Finder to see if your libXXX.a file exists in those directories. If the library exists elsewhere then you need to configure your Library Search Paths:
However there several details which you have not provided in your question when using a library within an app:
Is the library built as part of the Xcode project/workspace (as in the first image)?
Is the library supplied by a third-party with binary (.a) and header files (as in the second image)?
TL;DR: I ran make in the wrong directory so the paths were messed up.
Problem:
>make
linking ../build/release/yubikey-personalization-gui
/usr/x86_64-suse-linux/bin/ld: cannot find -llib
...
I ran into this when compiling the Yubikey Personalisation Tool. I tracked down the -llib call in my Makefile which looked like this:
...
LINK = #echo linking $# && g++
...
LIBS = $(SUBLIBS) -L/usr/lib64 -L../lib/release -llib -lyubikey -lykpers-1 -lQtGui -L/usr/lib64 -L/usr/X11R6/lib -lQtCore -lpthread
...
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
So it was setting a variable called LINK which would print "linking" and then call g++, which is the compiler.
Then it set the var LIBS which would hold the ominous -llib.
Then it composes and runs the command $(LINK) ... $(LIBS).
Which runs g++ with the parameter -llib.
And what does that do? Turns out -l<something> is telling the compiler to use the something-library. So it asks for the library called lib here. Which is strangely generic. I figured out that the sources came with a directory called lib/, which was at ../lib.
So starting make from a directory higher up fixed it.
You should remove libstdc++ from other linker flags in your xcode project
https://stackoverflow.com/a/53103383/1344237

Resources