ccurtsinger / interpose Goto Github PK
View Code? Open in Web Editor NEWFunction interposition for Linux and Mac OS
License: MIT License
Function interposition for Linux and Mac OS
License: MIT License
To reproduce, in examples/logger/Makefile
, change C++ standard to anything 17 or above.
This reproduces in a Docker container:
% docker run -it ubuntu
% apt update
% apt install build-essential clang git nano
% git clone https://github.com/ccurtsinger/interpose.git
% cd interpose/examples/logger
% nano Makefile # -std=c++17
% make
clang++ -shared -fPIC -Wl,-soname,interposer.so -I../../include --std=c++17 -o logger.so logger.cc -ldl
logger.cc:23:3: error: void function '__interpose_malloc' should not return a value [-Wreturn-type]
return result;
^ ~~~~~~
logger.cc:34:3: error: void function '__interpose_calloc' should not return a value [-Wreturn-type]
return result;
^ ~~~~~~
logger.cc:50:3: error: void function '__interpose_realloc' should not return a value [-Wreturn-type]
return result;
^ ~~~~~~
3 errors generated.
make: *** [Makefile:24: logger.so] Error 1
Seems pretty consistent across compilers, g++
gives a longer error message, possibly more detailed.
It does NOT reproduce on my Mac.
The conditional code for ELF platforms in the header is hidden behind #if defined(__linux__)
. This prevents it from building correctly on most ELF platforms (and will compile but not work on Linux with a.out binaries). The correct spelling for this test is #ifdef __ELF__
.
I'd like to investigate incorporating this into some of our PLASMA projects to simplify them; can you change the license to MIT / Apache or similar?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.