ColinIanKing / stress-ng

This is the stress-ng upstream project git repository. stress-ng will stress test a computer system in various selectable ways. It was designed to exercise various physical subsystems of a computer as well as the various operating system kernel interfaces.

Home Page:https://github.com/ColinIanKing/stress-ng

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Static x dynamic linking

danielt3 opened this issue · comments

Hello! I'm trying to use stress-ng in an deeply customized Android device. We have a clang70-based toolchain, vendor libs and some libc support (we don't actually know what is implemented and what is not). Kernel is around 3.6.x. For our development needs, this setup is fine. But now we want to use stress-ng as a benchmarking tool for several of our devices and start making comparisons between software releases and between devices. We think that stress-ng is a great tool for that.

Here are the facts:

  1. I can build and link stress-ng ok in the static-linking mode. In the dynamic linking, I got several libc errors about missing APIs (shared-memory, network, quotas). It seems that the static libc provided by the vendor is more complete;
  2. For the static link to work, I have to copy libGLES.so to libGLES.a because since I'm on static mode, it seems to try to link everything statically and the vendor does not provide libGLES.a for me to use. This one also leads me to think that the actual libGLES is not used at all otherwise linking would fail, am I right?

Questions:

  1. Is there a way to turn-off using GLES in the build system, even if it is present in the toolchain? In a more general question, what would be a generic way of turning on/off things in stress-ng build?
  2. Is there a way to link to libGLES dinamically even in static mode?
  3. This is a more personal question: in order to have the full-blown functionality of stress-ng what would be the options/flag the kernel must be built with? I couldn't find this information anywhere. I'm not sure what were the options the vendor used to build our kernels.

Thank you for your help.

Hi, apologies for the delay in replying, I was off on vacation.

One way to disable features is to do the following:

make clean
STATIC=1 make -f Makefile.config

then edit config.h and comment out or remove specific config #defines, e.g. remove #define HAVE_GLES2_H. Also edit the config file and remove the CONFIG_LDFLAGS setting that adds in the -lGLESv2 library.

then continue the build using:

STATIC=1 make

A fully blown stress-ng is hard to configure as most systems don't support all the features. One can look at the config.h file and see what is not configured to perhaps deduce what is missing in the auto feature detection stage when make -f Makeconfig.config is run.

Note that the auto-config mode of stress-ng depends on the build environment you are using. Normally static cross-compilation is tricky with stress-ng. Unfortunately static builds don't enable loading of dynamic libraries.

Does this help? Let me know.I will close this issue at the end of the month if I don't hear any more feedback.

Hello! Sorry about the delay! Yes, it helped a lot. Thank you for your help! I will close the issue myself. Thanks again.