How do you compile Pango on Amazon Linux? - amazon-ec2

I'm trying to compile a recent version of Pango (1.38 or later) on Amazon Linux 2017.9, the end goal being to compile a version of librsvg.
./configure doesn't give any errors, and I think I have all dependencies installed. However when I run make I get loads of warnings, and some errors.
Some examples:
Warnings:
pango-renderer.c:1463: Warning: Pango: invalid annotation option: nullable
pango-utils.c:131: Warning: Pango: invalid annotation option: nullable
pango-engine.h:123: Warning: Pango: invalid annotation option: nullable
pango-engine.h:170: Warning: Pango: missing ':' at column 20:
* PangoEngineShape
Errors:
autofit.c:(.text+0x82a6): undefined reference to `hb_buffer_create'
/home/ec2-user/build/lib/libfreetype.a(autofit.o): In function `af_shaper_buf_destroy':
/home/ec2-user/freetype-2.9/src/autofit/afshaper.c:441: undefined reference to `hb_buffer_destroy'
/home/ec2-user/build/lib/libfreetype.a(autofit.o): In function `af_shaper_buf_create':
autofit.c:(.text+0x6701): undefined reference to `hb_buffer_create'
/home/ec2-user/build/lib/libfreetype.a(autofit.o): In function `af_shaper_buf_destroy':
autofit.c:(.text+0x6714): undefined reference to `hb_buffer_destroy'
collect2: error: ld returned 1 exit status
linking of temporary binary failed: Command '['/bin/sh', '../libtool', '--mode=link', '--tag=CC', '--silent', 'gcc', '-o', '/home/ec2-user/pango-1.39.0/pango/tmp-introspect84YaJG/Pango-1.0', '-export-dynamic', '/home/ec2-user/pango-1.39.0/pango/tmp-introspect84YaJG/Pango-1.0.o', '-L.', 'libpango-1.0.la', '-Wl,--export-dynamic', '-pthread', '-L/home/ec2-user/build/lib', '-lgio-2.0', '-lgmodule-2.0', '-lgobject-2.0', '-lcairo', '-lglib-2.0', '-lfreetype']' returned non-zero exit status 1
make[4]: *** [Pango-1.0.gir] Error 1

I think the warnings come from the gobject-introspection step of the build.
Those errors indicate a missing harfbuzz library.

Related

Rbenv install of ruby 2.7.2 fails with the error [make: *** [Makefile:271: miniruby] Error 1] on termux-rooted

I am on android 7.1 running termux. I have recently installed rbenv to install ruby 2.7.2. Since the new ruby 3.0 release most of the tools have been broken. Ex:Metasploit. I have all the required dependencies. I have tried rbenv install 2.7.2 and RUBY_CONFIGURE_OPTS=--disable-install-doc rbenv install 2.7.2. It gives me this error when I type rbenv install 2.7.2`
ERROR:
Downloading ruby-2.7.2.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.2.tar.bz2
Installing ruby-2.7.2...
BUILD FAILED (Linux 3.10.49-gd9886247 using ruby-build 20210119)
Inspect or clean up the working tree at /data/data/com.termux/files/usr/tmp/ruby-build.20210215164020.20674.SccO9E
Results logged to /data/data/com.termux/files/usr/tmp/ruby-build.20210215164020.20674.log
Last 10 log lines:
linking miniruby
rb_mjit_header.h updated
/data/data/com.termux/files/usr/bin/ld: cont.o: in function `coroutine_initialize':
/data/data/com.termux/files/usr/tmp/ruby-build.20210215164020.20674.SccO9E/ruby-2.7.2/./coroutine/ucontext/Context.h:51: undefined reference to `makecontext'
/data/data/com.termux/files/usr/bin/ld: cont.o: in function `coroutine_initialize_main':
/data/data/com.termux/files/usr/tmp/ruby-build.20210215164020.20674.SccO9E/ruby-2.7.2/./coroutine/ucontext/Context.h:32: undefined reference to `getcontext'
/data/data/com.termux/files/usr/bin/ld: cont.o: in function `coroutine_transfer':
/data/data/com.termux/files/usr/tmp/ruby-build.20210215164020.20674.SccO9E/ruby-2.7.2/./coroutine/ucontext/Context.h:59: undefined reference to `swapcontext'
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:271: miniruby] Error 1
I have gave up after trying to fix this after 4 hours.
Here is the log file
compiling array.c
compiling mjit.c
WARNING: linker: /data/data/com.termux/files/home/.rbenv/versions/2.5.3/bin/ruby: unsupported flags DT_FLAGS_1=0x8000001
compiling coroutine/ucontext/Context.c
In file included from coroutine/ucontext/Context.c:14: coroutine/ucontext/Context.h:32:5: warning: implicitly declaring library function 'getcontext' with type 'int (ucontext_t *)' (aka 'int (struct ucontext *)') [-Wimplicit-function-dec
laration] getcontext(&context->state); ^
coroutine/ucontext/Context.h:32:5: note: include the header <setjmp.h> or explicitly provide a declaration for 'getcontext' coroutine/ucontext/Context.h:51:5: warning: implicit declaration of function 'makecontext' is invalid in C99 [-Wimplicit-function-declaration]
makecontext(&context->state, (void(*)(void))coroutine_trampoline, 2, (void*)start, (void*)context);
^
coroutine/ucontext/Context.h:59:5: warning: implicit declaration of function 'swapcontext' is invalid in C99 [-Wimplicit-function-declaration]
swapcontext(&current->state, &target->state);
^
3 warnings generated.
compiling enc/ascii.c
compiling enc/us_ascii.c
compiling enc/unicode.c compiling enc/utf_8.c
compiling enc/trans/newline.c
./revision.h unchanged
compiling version.c
1 warning generated.
building rb_mjit_header.h
linking miniruby
rb_mjit_header.h updated
/data/data/com.termux/files/usr/bin/ld: cont.o: in function `coroutine_initialize':
/data/data/com.termux/files/usr/tmp/ruby-build.20210215164020.20674.SccO9E/ruby-2.7.2/./coroutine/ucontext/Context.h:51: undefined reference to `makecontext'
/data/data/com.termux/files/usr/bin/ld: cont.o: in function `coroutine_initialize_main':
/data/data/com.termux/files/usr/tmp/ruby-build.20210215164020.20674.SccO9E/ruby-2.7.2/./coroutine/ucontext/Context.h:32: undefined reference to `getcontext'
/data/data/com.termux/files/usr/bin/ld: cont.o: in function `coroutine_transfer':
/data/data/com.termux/files/usr/tmp/ruby-build.20210215164020.20674.SccO9E/ruby-2.7.2/./coroutine/ucontext/Context.h:59: undefined reference to `swapcontext'
clang-11: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [Makefile:271: miniruby] Error 1
I have no idea what to do. I am a noob , So please explain what to do and THANKS in advance.

xgo cross compile not working for alsa-lib

Note: I have also created this as an issue for xgo here, but I thought it might be better suited as an SO question.
I am trying to cross compile my go application and one of the dependencies is the alsa.lib. I cannot get this to sucessfully compile using xgo.
Initially I tried with this command:
xgo --targets=linux/*,windows/*,darwin/* -deps=ftp://ftp.alsa-project.org/pub/lib/alsa-lib-1.1.8.tar.bz2 github.com/Lynges/susimup
And that produced this error:
/deps-build/alsa-lib-1.1.8/src/pcm/pcm_softvol.c:856: undefined reference to 'pow'
collect2: error: ld returned 1 exit status
2019/04/11 22:51:27 Failed to cross compile package: exit status 2
So then I added the depsargs to get --with-softfloat and that moved it along to a new error:
/deps-build/alsa-lib-1.1.8/src/pcm/pcm_meter.c:674: undefined reference to `dlsym'
collect2: error: ld returned 1 exit status
And that is where I am stuck now.
I have tried adding some more arguments like mentioned in the comment to this answer, but that just gave me a warning:
configure: WARNING: unrecognized options: --disable-alsamixer, --disable-xmto, --disable-nls, --disable-bat
So now I really have no idea what to do. I just want to cross compile my very simple app for arm so that it may be used on a Raspberry pi.

Error installing ruby 1.8 in ubuntu 18.04

I removed installed ruby: sudo apt-get purge ruby
and I Download and compile ruby:
wget http://cache.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p374.tar.gz
tar -xzvf ruby-1.8.7-p374.tar.gz
cd ruby-1.8.7-p374
./configure
AND Build a MakeFile using the specific compiler.
make CC=gcc-4.4
An error occurred when compiling.
Error in compiling openssl
compiling openssl
make[1]: 디렉터리 '/ruby-1.8.7-p374/ext/openssl' 들어감
gcc-4.4 -I. -I../.. -I../../. -I../.././ext/openssl -
DRUBY_EXTCONF_H=\"extconf.h\" -fPIC -g -O2 -c ossl_hmac.c
In file included from ossl.h:57,
from ossl_hmac.c:13:
/usr/include/openssl/asn1_mac.h:10: error: #error "This file is obsolete;
please update your software."
In file included from ossl.h:205,
from ossl_hmac.c:13:
openssl_missing.h:79: error: macro "EVP_MD_CTX_create" passed 1 arguments, but takes just 0
openssl_missing.h:83: error: expected declaration specifiers or ‘...’ before ‘(’ token
openssl_missing.h:83: error: conflicting types for ‘EVP_MD_CTX_reset’
/usr/include/openssl/evp.h:498: note: previous declaration of
‘EVP_MD_CTX_reset’ was here
openssl_missing.h:91: error: expected declaration specifiers or ‘...’ before ‘(’ token
ossl_hmac.c: In function ‘ossl_hmac_alloc’:
ossl_hmac.c:54: error: invalid application of ‘sizeof’ to incomplete type ‘HMAC_CTX’
ossl_hmac.c:54: error: invalid application of ‘sizeof’ to incomplete type ‘HMAC_CTX’ `enter code here`
ossl_hmac.c: In function ‘ossl_hmac_initialize’:
ossl_hmac.c:73: warning: ‘HMAC_Init’ is deprecated (declared at /usr/include/openssl/hmac.h:28)
ossl_hmac.c: In function ‘hmac_final’:
ossl_hmac.c:114: error: storage size of ‘final’ isn’t known
ossl_hmac.c: In function ‘ossl_hmac_reset’:
ossl_hmac.c:182: warning: ‘HMAC_Init’ is deprecated (declared at /usr/include/openssl/hmac.h:28)
Makefile:197: recipe for target 'ossl_hmac.o' failed
make[1]: *** [ossl_hmac.o] Error 1
make[1]: DIR '/ruby-1.8.7-p374/ext/openssl' 나감
Makefile:293: recipe for target 'all' failed
make: *** [all] Error 1`
How can i resolve this error..
I ran into a very similar error installing 1.9.3 on Ubuntu 18.04. I did the following to get around it -
sudo apt install libssl1.0-dev
and then rebuilt Ruby.

DSO missing from command line Compiling TrueCrypt

I've been trying to compile truecrypt 7.1a on Debian Jessie 8.1.0 AMD64 for the past two days now. I have wxGTK2.8.12 source because Debian Jessie only have v3.0 packages. That's a problem because wxwidgets3.0 has protected wxstandardpaths so you have to use wxstandardpaths::get and truecrypt uses wxstandardpaths in application.cpp for example and it would return an error while compiling.
I'm not sure how to fix that so I went to option 2 compile wxgtk2.8.12 source using the truecrypt compile option # make WX_ROOT=/usr/src/truecrypt-7.1a-source/wxGTK-2.8.12 wxbuild. That completes then I do # make WXSTATIC=1 and I run into this error below. Even if I compile and install wxwidgets-2.8.12 myself I get this error. Maybe it's a x11lib issue?
^
Linking truecrypt
/usr/bin/ld:
/usr/src/truecrypt-7.1a-source/wxrelease/lib/libwx_gtk2u_core-2.8.a(corelib_utilsx11.o): undefined reference to symbol 'XGetWindowAttributes'
//usr/lib/x86_64-linux-gnu/libX11.so.6: error adding symbols: DSO
missing from command line collect2: error: ld returned 1 exit status
Main.make:107: recipe for target 'truecrypt' failed make[1]: ***
[truecrypt] Error 1 Makefile:268: recipe for target 'all' failed make:
*** [all] Error 2

hidden symbol `__sync_fetch_and_add_4' is referenced by DSO

I am trying to Cross Compile opencv on linux platform (ARM 8148).
I am getting following errors:
warning: libQtTest.so.4, needed by ../../lib/libopencv_highgui.so.3.0.0, not found (try using -rpath or -rpath-link)
/opt/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: libQtCore.so.4, needed by ../../lib/libopencv_highgui.so.3.0.0, not found (try using -rpath or -rpath-link)
/opt/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: ../../bin/opencv_perf_core: hidden symbol `__sync_fetch_and_add_4' in /opt/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/libgcc.a(linux-atomic.o) is referenced by DSO
/opt/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
make[2]: *** [bin/opencv_perf_core] Error 1
make[1]: *** [modules/core/CMakeFiles/opencv_perf_core.dir/all] Error 2
I am not able to understand this error and on net also not getting proper reference for that .Can anyone help me in understanding this error .
__sync_fetch_and_add_x* is normally inlined by gcc, and compiles to inline code that performs an automic operation on a memory word.
You will find them documented here:
https://gcc.gnu.org/onlinedocs/gcc-4.9.1/gcc/_005f_005fsync-Builtins.html
As described on this page, if the compiler emitted a function call, instead of a generating inline assembly, it means that this atomic operation is not supported on the target platform.

Resources