CONFIG_TARGET_OPTIMIZATION is not applied

Not sure if a bug or user's error. Steps to reproduce:

  1. Start with the fresh clone, checkout latest tag.
  2. Copy diffconfig to .config as per Wiki.
  3. make defconfig

In my diffconfig I have the following line:

CONFIG_TARGET_OPTIMIZATION="-Os -pipe -march=btver2"

However in the resulting .config it is:

CONFIG_DEFAULT_TARGET_OPTIMIZATION="-Os -pipe"

Quick grep shows that other settings are applied correctly.

You've made a typo

-march=btver2

should be:

-march=bdver2

EDIT: It seems there is btverX also. :smiley:

So maybe the selection of a specific device is vanishing the parameter for a reason.

I was following APU2 Wiki page. The selection is preserved if entered manually in make menuconfig

there's always
CONFIG_EXTRA_GCC_CONFIG_OPTIONS="--with-arch=bdver2"
as well but that just makes it the default march when it's not overridden

1 Like

Could you show/share your seed config? I think you just miss a option before this setting which is required for expanding the other options resp. there is a difference between the to tags you show here.

e. g.

CONFIG_TARGET_OPTIONS=y
CONFIG_TARGET_OPTIMIZATION="-O2 -pipe -mcpu=cortex-a53+crc+crypto"

And there is a difference between:
CONFIG_TARGET_OPTIMIZATION
and
CONFIG_DEFAULT_TARGET_OPTIMIZATION
They can differ it does not hurt. Because the latter is the default if nothing else is set. So what is
CONFIG_TARGET_OPTIMIZATION
showing after expanding the config?

CONFIG_TARGET_OPTIMIZATION="-Os -pipe -march=btver2"

...am I right to guess this would prevail over the CONFIG_DEFAULT_TARGET_OPTIMIZATION ?

Yes, you usually do not overwrite the CONFIG_DEFAULT's resp. it is not necessary. I don't know how the exact meachnism here is. But it should work like an overwrite resp. an addition. On gcc you can pass like -Os -O2 and gcc is picking up the 2nd -O.

EDIT: You can verify if gcc is picking it up compiling with V=sc.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.