Category : compilation

__attribute__((weak)) void f1(); __attribute__((weak)) void f2(); void f2(){} int main() { assert(0 == f1); // always true? assert(0 != f2); // always true? } The GCC’s manual page is rather vague about whether a weak symbol is guaranteed to be zero-initialized if it’s not resolved at link time. Any definitive reference? Especially nice if it’s ..

Read more

I have been trying to run a simple LoopTools (https://doi.org/10.1016/S0010-4655(98)00173-8) code using c++ like this: #include <iostream> #include "clooptools.h" using namespace std; int main(){ ltini(); cout << B0(1000., 50., 80.) << endl; ltexi(); return 0; } According to the LoopTools manual, I should compile the code like this $LT/bin/fcc -I$LT/include example.cpp -L$LT/lib64 -looptools where LT ..

Read more

I’m currently trying to make a basic compiler on Windows using C++. And I was thinking about how to turn assembly into machine code or an exe file. If this were to be downloaded by another computer I think it wouldn’t work without having to attach an assembler and linker with it, like nasm and ..

Read more

We have a ndk library with initializing code like these: extern GL_APICALL void (*GL_APIENTRY glReadBuffer)(GLenum mode); glReadBuffer = (void*) eglGetProcAddress("glReadBuffer"); However, some android apps with this library always crash at function call eglGetProcAddress. Other apps with the same library won’t. eglGetProcAddress is a funciton provided by android system, generally in libegl.so. So I suppose that ..

Read more