-
Notifications
You must be signed in to change notification settings - Fork 6
Native static binaries cpu transparency fixes #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Thaodan
wants to merge
65
commits into
master
Choose a base branch
from
native_static_binaries_cpu_transparency_fixes_jb63379
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Native static binaries cpu transparency fixes #40
Thaodan
wants to merge
65
commits into
master
from
native_static_binaries_cpu_transparency_fixes_jb63379
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
meson incorrectly tries to use ccache if it's accelerated even when it does not exist Signed-off-by: Ville Nummela <ville.nummela@jolla.com>
[sb2] Conditionally accelerate ccache. JB#61370
Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
`egrep` and `fgrep` are deprecated, use `grep -E` or `grep -F` respectively. Replace `$(...)` notation instead of legacy backticks. Avoid useless `cat` where `read` can do the job better. Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
[sb2] Replace deprecated egrep, fgrep and cleanup
[sb2] Add gate for statx. JB#49501
Our sed is to old for the POSIX option. Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
…ption [sb2] Use GNU option for extended sed. JB#59434
Paths for ldconfig is relative to the root passed with -r. Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
Signed-off-by: Martin Kampas <martin.kampas@jolla.com>
Append to LD_PRELOAD instead of prepend, so that sb2, as the virtualization layer, sits at the very bottom. At least the Coverity scan build tool does not operate correctly if libsb2.so takes its action first. Signed-off-by: Martin Kampas <martin.kampas@jolla.com>
This (still) exists as a symlink to /usr/bin/env, so the rule should be included as we do in other similar cases.
[sb2] Fix ldconfig use at build time. JB#61808
[sb2] Fix compatibility with LD_PRELOAD-based tools. JB#61781
Accelerate sh/bash installed under /usr and more cleanups
Signed-off-by: Björn Bidar <bjorn.bidar@thaodan.de>
lua.h isn't always inside in /usr/include, take LUA_CFLAGS as taken from pkgconfig. Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
Fix declaration of tmpnam with glibc < 2.34 and gcc >= 11
i_virtualize_struct_statx was only implicitly defined in
vterm_statfuns.c as config.h which defines HAVE_STATX wasn't included.
Consistently include config.h before any other header to avoid issues
like these:
preload/vperm_filestatgates.c: In function ‘statx_gate’:
preload/vperm_filestatgates.c:272:17: error: implicit declaration of function ‘i_virtualize_struct_statx’; did you mean ‘i_virtualize_struct_stat’? [-Wimplicit-function-declaration]
272 | i_virtualize_struct_statx(realfnname, buf);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
| i_virtualize_struct_stat
Also use consistent include order and naming in all files.
Fixes: 0ecaef5 ([sb2] Add gate for statx. JB#49501)
Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
[sb2] Fix implicit declaration of function ‘i_virtualize_struct_statx’. Fixes JB#62739
include/elf.h:25:14: error: expected ‘;’ before ‘typedef’
25 | __BEGIN_DECLS
| ^
| ;
Fixes: 055cb96 (Incomplete OS X support)
Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
Fixes errors such as: include/rule_tree.h:22:9: error: unknown type name ‘uint32_t’ 22 | typedef uint32_t ruletree_object_offset_t; Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
preload/vperm_statfuncts.c:122:5: warning: no previous prototype for ‘i_virtualize_struct_stat_internal’ [-Wmissing-prototypes] 122 | int i_virtualize_struct_stat_internal( Fixes: 0ecaef5 ([sb2] Add gate for statx. JB#49501) Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
Previously in some instance the assumption was $(SRCDIR) = $(OBJDIR). If $(OBJDIR) isn't equal to $(SRCDIR) these files were not found anymore. Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
Resolves error when using a compiler with stricter settings such as when using LTO. Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
…JB#61866 Both open and openat load their last argument 'mode' lazily, using va_arg() only if O_CREAT is found in oflag. This is wrong, mode is also necessary if O_TMPFILE is in oflag. Adapt __OPEN_NEEDS_MODE(oflag) present since glibc 2.22 to solve the issue. Read more down below: https://sourceware.org/git/?p=glibc.git;a=commit;h=65f6f938cd562a614a68e15d0581a34b177ec29d Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
Once in autogen.sh and once in %make Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
Previously preload/exported.h depended on preload/wrappers.c even thou both where generated from interface.master by gen-interface.pl. Refactor so that all generated preloader files depend on the interface and the gen-interface script. Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
The builtin multilib support as unused. It's cleaner to built libsb2 for 32bit targets in a 32bit worker. The side effect of these changes is that make file pickup the correct directories passed to configure in %configure. Also now we can use regular build macros. Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
By detecting if configure.ac has changed and thus configure will change in the following step we can run autogen.sh and config.status to rerun configure with the previously set built options. The change removes the need for .configure file, correctly detects if configures sources changed and doesn't run configure again without all the previously passed options. Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
In case the root Makefile isn't in PWD assume that the Makefiles directory is the source directory. Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
Remove obsolete and unused things. Own all directories correctly (this will be an error in later RPM versions). Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
Remove useless checks like:
```
command
if [ $# -eq 0 ] ; then
error
fi
```
Or replace obsolescent -a and -o with `[ ] && [ ] ` and `[ ] || [ ]`.
https://github.com/koalaman/shellcheck/wiki/SC2166
https://github.com/koalaman/shellcheck/wiki/SC2181
Doing so exits with a clearer error message then errors about sb2d failing to start later such as these: Runtime-Error loading /tmp/sb2-bidar-20240329-145433.AwoNRb/lua_scripts/init.lua (...dar-20240329-145433.AwoNRb/lua_scripts/argvenvp_misc.lua:28: bad argument #1 to 'files' (/tmp/sb2-bidar-20240329-145433.AwoNRb/wrappers.sdk-build: No such file or directory)) sb2: Error: startup of sb2d failed. Tested-by: Björn Bidar <bjorn.bidar@jolla.com>
To make it easier to detect where Scratchbox2 helper scripts and binaries are found on the host and partially on the tooling/target. This is especially important for helper binaries such as sb2dctl. Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
The version used in the Makefile and version header was extracted using git with a phony target which resulted in unintended rebuilds. Using the autoconf script avoids these as now the version only updates when the autoconf script changes. Further the version originally set in the autoconf was also out of date. This change fixes both of these issues. The script in build-aux was taken from Gnulib. Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
Previously config.status was also clean as part of the clean making rebuilds impossible without calling configure again. Clean isn't supposed to clean the generated build- or distribution-system files. Further somefiles that should be clean where not cleaned at all. This change also aligns the name of the clean target which removes the distribution to the one configure mentions when it fails. Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
When configure.ac or config.mak.in change but not their output their will be repeated rebuilds as the timestamp their output files such as config.mak stay older than their dependency. The timestamp file's timestamp will always update after the targets dependency changed. Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
Co-authored-by: Matti Viljanen <matti.viljanen@jolla.com> Co-authored-by: Björn Bidar <bjorn.bidar@jolla.com> Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
In case not available. Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
Sets basic indentation across editors and reviews on Github. Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
The char arrays in sblog_vprintf_line_to_logfile where not initialized
which can cause the the call to vsnprintf can fail.
See for example the backtrace below:
from ~/dev/vms/jolla/targets/SailfishOS-devel-i486/lib/libc.so.6
level=9, format=0xf7f6c488 "%s gate: calling mapped syscall(%s) to %s",
ap=0xffcd9f10 "\304\035\367\367\005")
at ~/dev/sailfish/jolla/pkgs/pj_oss/scratchbox2/sblib/sb_log.c:318
level=9, format=0xf7f6c488 "%s gate: calling mapped syscall(%s) to %s")
at ~/dev/sailfish/jolla/pkgs/pj_oss/scratchbox2/sblib/sb_log.c:423
realfnname=0xf7f71988 <__func__.292> "syscall", number=5, ap=0xffcd9fc4 "\034\240\004\b")
at preload/syscallgate.c:91
Also remove some extra white space at end or in empty lines.
Originally based on work by Frajo Haider but completely reworked to use the existing interface system. Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
…c binaries Scratchbox added cpu transparency for native binaries which means scratchbox will call the cpu transparency method, i.e. calling qemu user-mode, for native binaries even when the targets architecture is compatible with the host. During the development the current stable version 2.2.x was branched of. The feature was added after the branch of 2.2.x to 2.2.x and then forward ported to master. Because of that the exec_flags for targets in modes added afterwards where not set. The filesystem rules to resolve the path of the transparency cmd was never added in master. After adding these two cputransparency for native binaries works again. [modes] Add missing fs_rules and policies for executing native static binaries. JB#62642
Fixes error's such as: /tmp/sb2-bidar-20241127-143308.ch6fLN/gdbinit:1: Error in sourced command file: Ambiguous command "def sb2-prepare": define, define-prefix. The syntax was change at some point, I don't know exactly when Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
000647f to
29856f8
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Scratchbox added cpu transparency for native binaries which means
scratchbox will call the cpu transparency method, i.e. calling qemu
user-mode, for native binaries even when the targets architecture
is compatible with the host.During the development the current stable version 2.2.x was branched
of.
The feature was added after the branch of 2.2.x to 2.2.x and then
forward ported to master.
Because of that the exec_flags for targets in modes added afterwards where not
set.
The filesystem rules to resolve the path of the transparency cmd was
never added in master.
After adding these two cputransparency for native binaries works again.
Contains #39.