Skip to content
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

No multiarch out of tree #32

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open

No multiarch out of tree #32

wants to merge 22 commits into from

Conversation

Thaodan
Copy link
Contributor

@Thaodan Thaodan commented Mar 29, 2024

Remove multilib for x86_64 and use autotools variables

d34c077

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.

Automatically detect out of tree builds

c73c772

In case the root Makefile isn't in PWD assume that the Makefiles
directory is the source directory.

Use autotools builtin system to rerun configure instead of our own

04f90b4

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.

Contains changes from #22 and #23.

@Thaodan Thaodan force-pushed the no_multiarch_out_of_tree branch 13 times, most recently from 2d657cb to 5558364 Compare March 31, 2024 22:06
@Thaodan Thaodan force-pushed the no_multiarch_out_of_tree branch 2 times, most recently from eda7b44 to 5ad4f24 Compare April 10, 2024 09:29
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>
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(

Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
@Thaodan Thaodan force-pushed the no_multiarch_out_of_tree branch 2 times, most recently from bb58b38 to b43cf32 Compare October 28, 2024 09:43
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>
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>
Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
@Thaodan Thaodan force-pushed the no_multiarch_out_of_tree branch 2 times, most recently from 6947937 to a74fda8 Compare November 24, 2024 13:57
@Thaodan Thaodan force-pushed the no_multiarch_out_of_tree branch 13 times, most recently from 53b9268 to ce8415b Compare November 25, 2024 00:19
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>
@Thaodan Thaodan force-pushed the no_multiarch_out_of_tree branch 4 times, most recently from d749a26 to bed6c95 Compare November 25, 2024 10:24
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant