Skip to content
This repository has been archived by the owner on Jul 1, 2020. It is now read-only.

--tiny is different from a manual tiny config? #169

Closed
FAMILIAR-project opened this issue Jul 3, 2019 · 7 comments
Closed

--tiny is different from a manual tiny config? #169

FAMILIAR-project opened this issue Jul 3, 2019 · 7 comments
Labels

Comments

@FAMILIAR-project
Copy link
Collaborator

FAMILIAR-project commented Jul 3, 2019

I've done the following experiment.
Locally, using the 4.15 source of Linux kernel:
KCONFIG_ALLCONFIG=x86.config make tinyconfig
where content of x86.config is CONFIG_64BIT=y

it gives me a .config that I fed to tuxml...
python3 kernel_generator.py --linux4_version 15 --config /Users/macher1/Documents/SANDBOX/linuxevo/linux-4.15/.config
(it's what I called local tiny)

Then, I've tried to use:
python3 kernel_generator.py --linux4_version 15 --tiny

I'm expecting the same result, but it's not the case:

  • 63659 is --tiny: size is 11542064
  • 63660 is local tiny: size is 12021584
  • 63661 is local tiny (replication, same result as 63660)
  • 63662 is --tiny (replication, same result as 63659)

The two configurations differ, see the gist https://gist.github.com/FAMILIAR-project/342d9ed8d4136e1f033afaa4cd28ba34

diff ~/Downloads/config-tiny-tuxml ~/Downloads/config-tiny-local
59c59
< # CONFIG_KERNEL_GZIP is not set
---
> CONFIG_KERNEL_GZIP=y
62c62
< CONFIG_KERNEL_XZ=y
---
> # CONFIG_KERNEL_XZ is not set
126,127c126,127
< # CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set
< CONFIG_CC_OPTIMIZE_FOR_SIZE=y
---
> CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y
> # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
166,167c166,167
< # CONFIG_SLUB is not set
< CONFIG_SLOB=y
---
> CONFIG_SLUB=y
> # CONFIG_SLOB is not set
168a169,170
> # CONFIG_SLAB_FREELIST_RANDOM is not set
> # CONFIG_SLAB_FREELIST_HARDENED is not set
201a204
> CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y
864a868
> # CONFIG_KASAN is not set
978c982
< CONFIG_OPTIMIZE_INLINING=y
---
> # CONFIG_OPTIMIZE_INLINING is not set
982c986
< # CONFIG_UNWINDER_ORC is not set
---
> CONFIG_UNWINDER_ORC=y
984c988
< CONFIG_UNWINDER_GUESS=y
---
> # CONFIG_UNWINDER_GUESS is not set
992a997,998
> CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR=y
> # CONFIG_HARDENED_USERCOPY is not set
vmacher:linux-4.15 macher1$
@FAMILIAR-project
Copy link
Collaborator Author

I confirm the "bug" even with --dev
python3 kernel_generator.py --linux4_version 15 --dev --config /Users/macher1/Documents/SANDBOX/linuxevo/linux-4.15/.config

@FAMILIAR-project
Copy link
Collaborator Author

@FAMILIAR-project
Copy link
Collaborator Author

FAMILIAR-project commented Jul 4, 2019

I have severe doubts about https://github.com/TuxML/ProjetIrma/blob/dev/compilation/compiler.py#L319-L331

I suspect the "original configuration file" is not really restored.
I suspect we send the configuration file with the last compression option

@FAMILIAR-project
Copy link
Collaborator Author

FAMILIAR-project commented Jul 5, 2019

edit: I'm using MacOS and I suspect the inconsistency is due to an incorrect setup... Anyway, see next comment, the Docker-based trace is as disturbing

I don't know if it helps, but it's disturbing.
I download a fresh 4.15 and then

vmacher:linux-4.15 macher1$ cat x86.config CONFIG_64BIT=y
KCONFIG_ALLCONFIG="x86.config" make tinyconfig

vmacher:linux-4.15 macher1$ KCONFIG_ALLCONFIG="x86.config" make tinyconfig
getconf: no such configuration parameter `LFS_CFLAGS'
getconf: no such configuration parameter `LFS_LDFLAGS'
getconf: no such configuration parameter `LFS_LIBS'
  HOSTCC  scripts/basic/fixdep
getconf: no such configuration parameter `LFS_CFLAGS'
getconf: no such configuration parameter `LFS_LDFLAGS'
getconf: no such configuration parameter `LFS_LIBS'
  HOSTCC  scripts/kconfig/conf.o
scripts/kconfig/conf.c:78:10: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
                printf(_("aborted!\n\n"));
                       ^~~~~~~~~~~~~~~~~
scripts/kconfig/lkc.h:34:17: note: expanded from macro '_'
#define _(text) gettext(text)
                ^~~~~~~~~~~~~
scripts/kconfig/conf.c:78:10: note: treat the string as an argument to avoid this
                printf(_("aborted!\n\n"));
                       ^
                       "%s",
scripts/kconfig/lkc.h:34:17: note: expanded from macro '_'
#define _(text) gettext(text)
                ^
scripts/kconfig/conf.c:79:10: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
                printf(_("Console input/output is redirected. "));
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/kconfig/lkc.h:34:17: note: expanded from macro '_'
#define _(text) gettext(text)
                ^~~~~~~~~~~~~
scripts/kconfig/conf.c:79:10: note: treat the string as an argument to avoid this
                printf(_("Console input/output is redirected. "));
                       ^
                       "%s",
scripts/kconfig/lkc.h:34:17: note: expanded from macro '_'
#define _(text) gettext(text)
                ^
scripts/kconfig/conf.c:80:10: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
                printf(_("Run 'make oldconfig' to update configuration.\n\n"));
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/kconfig/lkc.h:34:17: note: expanded from macro '_'
#define _(text) gettext(text)
                ^~~~~~~~~~~~~
scripts/kconfig/conf.c:80:10: note: treat the string as an argument to avoid this
                printf(_("Run 'make oldconfig' to update configuration.\n\n"));
                       ^
                       "%s",
scripts/kconfig/lkc.h:34:17: note: expanded from macro '_'
#define _(text) gettext(text)
                ^
scripts/kconfig/conf.c:90:10: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
                printf(_("(NEW) "));
                       ^~~~~~~~~~~
scripts/kconfig/lkc.h:34:17: note: expanded from macro '_'
#define _(text) gettext(text)
                ^~~~~~~~~~~~~
scripts/kconfig/conf.c:90:10: note: treat the string as an argument to avoid this
                printf(_("(NEW) "));
                       ^
                       "%s",
scripts/kconfig/lkc.h:34:17: note: expanded from macro '_'
#define _(text) gettext(text)
                ^
scripts/kconfig/conf.c:291:12: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
                                printf(_(" (NEW)"));
                                       ^~~~~~~~~~~
scripts/kconfig/lkc.h:34:17: note: expanded from macro '_'
#define _(text) gettext(text)
                ^~~~~~~~~~~~~
scripts/kconfig/conf.c:291:12: note: treat the string as an argument to avoid this
                                printf(_(" (NEW)"));
                                       ^
                                       "%s",
scripts/kconfig/lkc.h:34:17: note: expanded from macro '_'
#define _(text) gettext(text)
                ^
scripts/kconfig/conf.c:439:13: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
                                        printf(_("*\n* Restart config...\n*\n"));
                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/kconfig/lkc.h:34:17: note: expanded from macro '_'
#define _(text) gettext(text)
                ^~~~~~~~~~~~~
scripts/kconfig/conf.c:439:13: note: treat the string as an argument to avoid this
                                        printf(_("*\n* Restart config...\n*\n"));
                                               ^
                                               "%s",
scripts/kconfig/lkc.h:34:17: note: expanded from macro '_'
#define _(text) gettext(text)
                ^
scripts/kconfig/conf.c:641:6: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
                                        _("\n*** The configuration requires explicit update.\n\n"));
                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/kconfig/lkc.h:34:17: note: expanded from macro '_'
#define _(text) gettext(text)
                ^~~~~~~~~~~~~
scripts/kconfig/conf.c:641:6: note: treat the string as an argument to avoid this
                                        _("\n*** The configuration requires explicit update.\n\n"));
                                        ^
                                        "%s",
scripts/kconfig/lkc.h:34:17: note: expanded from macro '_'
#define _(text) gettext(text)
                ^
scripts/kconfig/conf.c:694:20: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
                        fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n"));
                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/kconfig/lkc.h:34:17: note: expanded from macro '_'
#define _(text) gettext(text)
                ^~~~~~~~~~~~~
scripts/kconfig/conf.c:694:20: note: treat the string as an argument to avoid this
                        fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n"));
                                        ^
                                        "%s",
scripts/kconfig/lkc.h:34:17: note: expanded from macro '_'
#define _(text) gettext(text)
                ^
scripts/kconfig/conf.c:698:20: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
                        fprintf(stderr, _("\n*** Error during update of the configuration.\n\n"));
                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/kconfig/lkc.h:34:17: note: expanded from macro '_'
#define _(text) gettext(text)
                ^~~~~~~~~~~~~
scripts/kconfig/conf.c:698:20: note: treat the string as an argument to avoid this
                        fprintf(stderr, _("\n*** Error during update of the configuration.\n\n"));
                                        ^
                                        "%s",
scripts/kconfig/lkc.h:34:17: note: expanded from macro '_'
#define _(text) gettext(text)
                ^
scripts/kconfig/conf.c:709:20: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
                        fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n"));
                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/kconfig/lkc.h:34:17: note: expanded from macro '_'
#define _(text) gettext(text)
                ^~~~~~~~~~~~~
scripts/kconfig/conf.c:709:20: note: treat the string as an argument to avoid this
                        fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n"));
                                        ^
                                        "%s",
scripts/kconfig/lkc.h:34:17: note: expanded from macro '_'
#define _(text) gettext(text)
                ^
10 warnings generated.
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf  --allnoconfig Kconfig
#
# configuration written to .config
#
getconf: no such configuration parameter `LFS_CFLAGS'
getconf: no such configuration parameter `LFS_LDFLAGS'
getconf: no such configuration parameter `LFS_LIBS'
Using .config as base
Merging ./kernel/configs/tiny.config
**Value of CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is redefined by fragment ./kernel/configs/tiny.config:
Previous value: CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y
New value: # CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set**

sed: 1: "./.tmp.config.7AGG4cKD1T": invalid command code .
Value of CONFIG_CC_OPTIMIZE_FOR_SIZE is redefined by fragment ./kernel/configs/tiny.config:
Previous value: # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
New value: CONFIG_CC_OPTIMIZE_FOR_SIZE=y

sed: 1: "./.tmp.config.7AGG4cKD1T": invalid command code .
Value of CONFIG_KERNEL_GZIP is redefined by fragment ./kernel/configs/tiny.config:
Previous value: CONFIG_KERNEL_GZIP=y
New value: # CONFIG_KERNEL_GZIP is not set

sed: 1: "./.tmp.config.7AGG4cKD1T": invalid command code .
sed: 1: "./.tmp.config.7AGG4cKD1T": invalid command code .
sed: 1: "./.tmp.config.7AGG4cKD1T": invalid command code .
Value of CONFIG_KERNEL_XZ is redefined by fragment ./kernel/configs/tiny.config:
Previous value: # CONFIG_KERNEL_XZ is not set
New value: CONFIG_KERNEL_XZ=y

sed: 1: "./.tmp.config.7AGG4cKD1T": invalid command code .
sed: 1: "./.tmp.config.7AGG4cKD1T": invalid command code .
sed: 1: "./.tmp.config.7AGG4cKD1T": invalid command code .
Value of CONFIG_OPTIMIZE_INLINING is redefined by fragment ./kernel/configs/tiny.config:
Previous value: # CONFIG_OPTIMIZE_INLINING is not set
New value: CONFIG_OPTIMIZE_INLINING=y

sed: 1: "./.tmp.config.7AGG4cKD1T": invalid command code .
sed: 1: "./.tmp.config.7AGG4cKD1T": invalid command code .
Value of CONFIG_SLUB is redefined by fragment ./kernel/configs/tiny.config:
Previous value: CONFIG_SLUB=y
New value: # CONFIG_SLUB is not set

sed: 1: "./.tmp.config.7AGG4cKD1T": invalid command code .
Value of CONFIG_SLOB is redefined by fragment ./kernel/configs/tiny.config:
Previous value: # CONFIG_SLOB is not set
New value: CONFIG_SLOB=y

sed: 1: "./.tmp.config.7AGG4cKD1T": invalid command code .
Merging ./arch/x86/configs/tiny.config
Value of CONFIG_UNWINDER_GUESS is redefined by fragment ./arch/x86/configs/tiny.config:
Previous value: # CONFIG_UNWINDER_GUESS is not set
New value: CONFIG_UNWINDER_GUESS=y

sed: 1: "./.tmp.config.7AGG4cKD1T": invalid command code .
sed: 1: "./.tmp.config.7AGG4cKD1T": invalid command code .
cp: illegal option -- T
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
#
# merged configuration written to .config (needs make)
#
getconf: no such configuration parameter `LFS_CFLAGS'
getconf: no such configuration parameter `LFS_LDFLAGS'
getconf: no such configuration parameter `LFS_LIBS'
scripts/kconfig/conf  --oldconfig Kconfig
#
# configuration written to .config
#
vmacher:linux-4.15 macher1$
grep "CONFIG_CC_OPTIMIZE_FOR_SIZE" .config
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set

despite the fact tinyconfig has such pre-set options!

My point: we retrieve our options above

@FAMILIAR-project
Copy link
Collaborator Author

Using the Docker image, it seems more consistent (CC_OPTIMIZE_FOR_SIZE has 'y' value!) but the trace is worth studying

KCONFIG_ALLCONFIG=/TuxML/compilation/x64.config make tinyconfig
scripts/kconfig/conf  --allnoconfig Kconfig
#
# configuration written to .config
#
Using .config as base
Merging ./kernel/configs/tiny.config
Value of CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is redefined by fragment ./kernel/configs/tiny.config:
Previous value: CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y
New value: # CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set

Value of CONFIG_CC_OPTIMIZE_FOR_SIZE is redefined by fragment ./kernel/configs/tiny.config:
Previous value: # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
New value: CONFIG_CC_OPTIMIZE_FOR_SIZE=y

Value of CONFIG_KERNEL_GZIP is redefined by fragment ./kernel/configs/tiny.config:
Previous value: CONFIG_KERNEL_GZIP=y
New value: # CONFIG_KERNEL_GZIP is not set

Value of CONFIG_KERNEL_XZ is redefined by fragment ./kernel/configs/tiny.config:
Previous value: # CONFIG_KERNEL_XZ is not set
New value: CONFIG_KERNEL_XZ=y

Value of CONFIG_OPTIMIZE_INLINING is redefined by fragment ./kernel/configs/tiny.config:
Previous value: # CONFIG_OPTIMIZE_INLINING is not set
New value: CONFIG_OPTIMIZE_INLINING=y

Value of CONFIG_SLUB is redefined by fragment ./kernel/configs/tiny.config:
Previous value: CONFIG_SLUB=y
New value: # CONFIG_SLUB is not set

Value of CONFIG_SLOB is redefined by fragment ./kernel/configs/tiny.config:
Previous value: # CONFIG_SLOB is not set
New value: CONFIG_SLOB=y

Merging ./arch/x86/configs/tiny.config
Value of CONFIG_UNWINDER_GUESS is redefined by fragment ./arch/x86/configs/tiny.config:
Previous value: # CONFIG_UNWINDER_GUESS is not set
New value: CONFIG_UNWINDER_GUESS=y

#
# merged configuration written to .config (needs make)
#
scripts/kconfig/conf  --oldconfig Kconfig
.config:1046:warning: override: UNWINDER_GUESS changes choice state
#
# configuration written to .config
#

@psaffray
Copy link
Contributor

psaffray commented Jul 5, 2019

I do
psaffray@STAG01DVRSE:~/ProjetIrma$ cat x86.config CONFIG_64BIT=y psaffray@STAG01DVRSE:~/ProjetIrma/linux-4.15$ KCONFIG_ALLCONFIG=x86.config make tinyconfig psaffray@STAG01DVRSE:~/ProjetIrma/linux-4.15$ cp linux-4.15/.config .. psaffray@STAG01DVRSE:~/ProjetIrma/linux-4.15$ cd.. psaffray@STAG01DVRSE:~/ProjetIrma$ ./kernel_generator.py --dev --linux4_version 15 --config .config cid 63683 -> manual_tiny.config
and then
psaffray@STAG01DVRSE:~/ProjetIrma$ python3 kernel_generator.py --dev --linux4_version 15 --tiny
cid 63684 -> with-tiny-flag.config
Finally psaffray@STAG01DVRSE:~/Téléchargements$ diff manual_tiny.config with-tiny-flag.config psaffray@STAG01DVRSE:~/Téléchargements$
No difference found on my machine

@FAMILIAR-project
Copy link
Collaborator Author

Ok then it is not a real issue, we can even close it. It is due to my MacOS setup.

Incidentally it helps us to find another possible critical issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants