unsupported directive '.stabs' - gcc

I'm compiling my code with clang while compiling i'm getting below error with satbs
:1:8: error: unsupported directive '.stabs'
.stabs "warning",30,0,0,0
^
:2:8: error: unsupported directive '.stabs'
.stabs "_setlocale",1,0,0,0
^

Related

Compiling kernel using GCC error unknown mnemonic

AS arch/arm64/mm/proc.o
../arch/arm64/mm/proc.S: Assembler messages:
../arch/arm64/mm/proc.S:283: Error: unknown mnemonic `pte_to_phys' -- `pte_to_phys cur_pmdp,pud'
../arch/arm64/mm/proc.S:302: Error: unknown mnemonic `pte_to_phys' -- `pte_to_phys cur_ptep,pmd'
Fixing an issue error build

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.

Installing gosu on FreeBSD

I'm trying to install this Ruby gem on FreeBSD, and it's failing with the following error:
# gem install gosu
Building native extensions. This could take a while...
ERROR: Error installing gosu:
ERROR: Failed to build gem native extension.
current directory: /usr/local/lib/ruby/gems/2.4/gems/gosu-0.14.5/ext/gosu
/usr/local/bin/ruby24 -I /usr/local/lib/ruby/site_ruby/2.4 -r ./siteconf20190322-6847-x8s25j.rb extconf.rb
The Gosu gem requires some libraries to be installed system-wide.
See the following site for a list:
https://github.com/gosu/gosu/wiki/Getting-Started-on-Linux
cat: /proc/cpuinfo: No such file or directory
checking for -lopenal... yes
checking for AL/al.h... yes
creating Makefile
current directory: /usr/local/lib/ruby/gems/2.4/gems/gosu-0.14.5/ext/gosu
make "DESTDIR=" clean
current directory: /usr/local/lib/ruby/gems/2.4/gems/gosu-0.14.5/ext/gosu
make "DESTDIR="
compiling ../../src/Audio.cpp
In file included from ../../src/Audio.cpp:17:
../../src/SndFile.hpp:111:33: warning: field 'buffer' is uninitialized when used here [-Wuninitialized]
: file(nullptr), reader(buffer.front_reader())
^
../../src/SndFile.hpp:123:33: warning: field 'buffer' is uninitialized when used here [-Wuninitialized]
: file(nullptr), reader(buffer.front_reader())
^
2 warnings generated.
compiling ../../src/AudioImpl.cpp
compiling ../../src/Bitmap.cpp
compiling ../../src/BitmapIO.cpp
compiling ../../src/BlockAllocator.cpp
compiling ../../src/Channel.cpp
compiling ../../src/Color.cpp
compiling ../../src/DirectoriesApple.cpp
compiling ../../src/DirectoriesUnix.cpp
compiling ../../src/DirectoriesWin.cpp
compiling ../../src/FileUnix.cpp
../../src/FileUnix.cpp:53:47: error: use of undeclared identifier 'S_IRUSR'
pimpl->fd = open(filename.c_str(), flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
^
../../src/FileUnix.cpp:53:55: error: use of undeclared identifier 'S_IWUSR'
pimpl->fd = open(filename.c_str(), flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
^
../../src/FileUnix.cpp:53:63: error: use of undeclared identifier 'S_IRGRP'
pimpl->fd = open(filename.c_str(), flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
^
../../src/FileUnix.cpp:53:71: error: use of undeclared identifier 'S_IWGRP'
pimpl->fd = open(filename.c_str(), flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
^
../../src/FileUnix.cpp:53:79: error: use of undeclared identifier 'S_IROTH'
pimpl->fd = open(filename.c_str(), flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
^
../../src/FileUnix.cpp:53:87: error: use of undeclared identifier 'S_IWOTH'
pimpl->fd = open(filename.c_str(), flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
^
6 errors generated.
*** Error code 1
Stop.
make: stopped in /usr/local/lib/ruby/gems/2.4/gems/gosu-0.14.5/ext/gosu
Other things I tried:
Switching compilers - from clang and c++ to g++ and gcc.
Cloning the repository and building "manually" - got the same errors.
Is it even possible to install it on FreeBSD? Searches didn't return anything useful.
On FreeBSD system headers are organized slightly differently than in Linux.
Quick man lookup reveals, that you need to
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
to make these definitions visible.

error: ‘deprecated’ was not declared in this scope

I updated my program to --std=c++11 and now I get:
g++ --std=c++11 -c eqc.cpp
In file included from eqc.cpp:16:0:
eqc.h:372:80: error: ‘deprecated’ was not declared in this scope
eqc.h:372:92: error: expected ‘)’ before ‘;’ token
eqc.h:372:92: error: expected ‘)’ before ‘;’ token
In file included from eqc.cpp:16:0:
eqc.h:372:74: error: expected unqualified-id before ‘)’ token
equation &operator[](const std::string &label) __attribute__((deprecated));
If I use the new way of specifying attributes, it's the same:
In file included from eqc.cpp:16:0:
eqc.h:371:67: error: ‘deprecated’ was not declared in this scope
eqc.h:371:79: error: expected ‘]’ before ‘;’ token
In file included from eqc.cpp:16:0:
eqc.h:371:61: error: expected unqualified-id before ‘]’ token
equation &operator[](const std::string &label) [[deprecated]];
Since I can't find anything on the web about this error, I must be making some silly mistake. But which?
The system is Ubuntu 16.04 and the compiler:
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
The problem was a library (libginac6 1.7.0) that said
#define deprecated attribute ((deprecated));
After updating the library (to version >= 1.7.1) the error disappeared since the library now says
#define attribute_deprecated attribute ((deprecated));

Is it possible to build FreeGLUT on Mac OS X?

I'm doing some tutorials on OpenGL that use FreeGLUT.
Apparently this is how you build and install it on the mac:
CPPFLAGS="-I/usr/X11R6/include" ./configure --prefix="${PWD}/../"
make
make install
Unfortunately this on its own gives me an error when I do the make command: Undefined symbols for architecture x86_64
After doing abit of work I've found that an improvement on the first line is:
CPPFLAGS="-I/usr/X11R6/include -L/usr/X11R6/lib" LDFLAGS="-L/usr/X11R6/lib" ./configure --prefix="${PWD}/../"
Unfortunately when I do the make command I'm still getting an error:
gcc -DHAVE_CONFIG_H -I. -I../../.. -I/usr/X11R6/include -L/usr/X11R6/lib -I../../../include -g -O2 -Wall -pedantic -MT smooth_opengl3-smooth_opengl3.o -MD -MP -MF .deps/smooth_opengl3-smooth_opengl3.Tpo -c -o smooth_opengl3-smooth_opengl3.o `test -f 'smooth_opengl3.c' || echo './'`smooth_opengl3.c
smooth_opengl3.c:101: error: redefinition of typedef ‘PFNGLGENBUFFERSPROC’
/usr/X11R6/include/GL/glext.h:5080: error: previous declaration of ‘PFNGLGENBUFFERSPROC’ was here
smooth_opengl3.c:102: error: redefinition of typedef ‘PFNGLBINDBUFFERPROC’
/usr/X11R6/include/GL/glext.h:5078: error: previous declaration of ‘PFNGLBINDBUFFERPROC’ was here
smooth_opengl3.c:103: error: redefinition of typedef ‘PFNGLBUFFERDATAPROC’
/usr/X11R6/include/GL/glext.h:5082: error: previous declaration of ‘PFNGLBUFFERDATAPROC’ was here
smooth_opengl3.c:104: error: redefinition of typedef ‘PFNGLCREATESHADERPROC’
/usr/X11R6/include/GL/glext.h:5197: error: previous declaration of ‘PFNGLCREATESHADERPROC’ was here
smooth_opengl3.c:105: error: redefinition of typedef ‘PFNGLSHADERSOURCEPROC’
/usr/X11R6/include/GL/glext.h:5222: error: previous declaration of ‘PFNGLSHADERSOURCEPROC’ was here
smooth_opengl3.c:106: error: redefinition of typedef ‘PFNGLCOMPILESHADERPROC’
/usr/X11R6/include/GL/glext.h:5195: error: previous declaration of ‘PFNGLCOMPILESHADERPROC’ was here
smooth_opengl3.c:107: error: redefinition of typedef ‘PFNGLCREATEPROGRAMPROC’
/usr/X11R6/include/GL/glext.h:5196: error: previous declaration of ‘PFNGLCREATEPROGRAMPROC’ was here
smooth_opengl3.c:108: error: redefinition of typedef ‘PFNGLATTACHSHADERPROC’
/usr/X11R6/include/GL/glext.h:5193: error: previous declaration of ‘PFNGLATTACHSHADERPROC’ was here
smooth_opengl3.c:109: error: redefinition of typedef ‘PFNGLLINKPROGRAMPROC’
/usr/X11R6/include/GL/glext.h:5221: error: previous declaration of ‘PFNGLLINKPROGRAMPROC’ was here
smooth_opengl3.c:110: error: redefinition of typedef ‘PFNGLUSEPROGRAMPROC’
/usr/X11R6/include/GL/glext.h:5223: error: previous declaration of ‘PFNGLUSEPROGRAMPROC’ was here
smooth_opengl3.c:111: error: redefinition of typedef ‘PFNGLGETSHADERIVPROC’
/usr/X11R6/include/GL/glext.h:5209: error: previous declaration of ‘PFNGLGETSHADERIVPROC’ was here
smooth_opengl3.c:112: error: redefinition of typedef ‘PFNGLGETSHADERINFOLOGPROC’
/usr/X11R6/include/GL/glext.h:5210: error: previous declaration of ‘PFNGLGETSHADERINFOLOGPROC’ was here
smooth_opengl3.c:113: error: redefinition of typedef ‘PFNGLGETPROGRAMIVPROC’
/usr/X11R6/include/GL/glext.h:5207: error: previous declaration of ‘PFNGLGETPROGRAMIVPROC’ was here
smooth_opengl3.c:114: error: redefinition of typedef ‘PFNGLGETPROGRAMINFOLOGPROC’
/usr/X11R6/include/GL/glext.h:5208: error: previous declaration of ‘PFNGLGETPROGRAMINFOLOGPROC’ was here
smooth_opengl3.c:115: error: redefinition of typedef ‘PFNGLGETATTRIBLOCATIONPROC’
/usr/X11R6/include/GL/glext.h:5206: error: previous declaration of ‘PFNGLGETATTRIBLOCATIONPROC’ was here
smooth_opengl3.c:116: error: redefinition of typedef ‘PFNGLVERTEXATTRIBPOINTERPROC’
/usr/X11R6/include/GL/glext.h:5280: error: previous declaration of ‘PFNGLVERTEXATTRIBPOINTERPROC’ was here
smooth_opengl3.c:117: error: redefinition of typedef ‘PFNGLENABLEVERTEXATTRIBARRAYPROC’
/usr/X11R6/include/GL/glext.h:5202: error: previous declaration of ‘PFNGLENABLEVERTEXATTRIBARRAYPROC’ was here
smooth_opengl3.c:118: error: redefinition of typedef ‘PFNGLGETUNIFORMLOCATIONPROC’
/usr/X11R6/include/GL/glext.h:5212: error: previous declaration of ‘PFNGLGETUNIFORMLOCATIONPROC’ was here
smooth_opengl3.c:119: error: redefinition of typedef ‘PFNGLUNIFORMMATRIX4FVPROC’
/usr/X11R6/include/GL/glext.h:5242: error: previous declaration of ‘PFNGLUNIFORMMATRIX4FVPROC’ was here
make[4]: *** [smooth_opengl3-smooth_opengl3.o] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
This has been documented on the net before, but the solution isn't really all that helpful in this instance. I've also tried swapping it for the GLUT.framwork that comes with OS X, but the examples are using FreeGLUT-specific functions.
XQuartz 2.7.2 swapped to FreeGLUT (2.8.0) instead of the old MesaGLUT. So provided you have OS X version 10.6.3 or later, you can just install XQuartz 2.7.2 or later. See:
http://xquartz.macosforge.org/trac/wiki/X112.7.2
http://lists.apple.com/archives/x11-users/2012/Apr/msg00020.html
It was suggested on Xquartz's mail list, that the freeglut demo is wrong to declare those PFN*PROC twice.
So, by simply commenting out those double-definition from smooth_opengl3.c, the free glut would pass the compilation phase. However, from my experience, it would not run and give some error about the GLSL.
It was also suggested that GLUT framework should be used on Mac OS X.
It´s working for me with the following parameters to configure:
./configure CFLAGS="-I/usr/X11/include/X11/extensions -L/usr/X11/lib" LIBS="-lXrandr -lXxf86vm -lXi" --with-x --x-includes=/usr/X11/include

Resources