All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhangjin Wu <falcon@tinylab.org>
To: thomas@t-8ch.de, w@1wt.eu
Cc: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org, linux@weissschuh.net,
	tanyuan@tinylab.org
Subject: Re: [PATCH v4 08/12] selftests/nolibc: add test support for ppc
Date: Thu,  3 Aug 2023 00:03:58 +0800	[thread overview]
Message-ID: <20230802160358.407890-1-falcon@tinylab.org> (raw)
In-Reply-To: <20230802103217.231036-1-falcon@tinylab.org>

Hi, Willy, Hi Thomas

I'm so happy to share with you, we have solved all of the left found
issues, include the ones about ppc and the missing poweroff options for
the tinyconfig series, will renew both series ;-)

> Further compared the preprocessed files, found the root cause is the new
> compiler using 'no_stack_protector' instead of
> '__optimize__("-fno-stack-protector")'. And the attribute 'no_stack_protector'
> breaks our "omit-frame-pointer" like the failure with '-O0' we fixed before.
> 
> I checked some of the other architectures, they didn't have the same issue, but
> test shows the 'no_stack_protector' attribute does have such compability issue
> here.
> 
> I learned the commit message of tools/include/nolibc/compiler.h, seems
> __optimize__("-fno-stack-protector") is enough for all of the nolibc supported
> architectures? is it ok for us to simply give up 'no_stack_protector'
> eventully? otherwise, we should manually disable 'no_stack_protector' for
> ppc32:
> 
>     #define __no_stack_protector __attribute__((__optimize__("-fno-stack-protector")))
>

Hello, any suggestion here? ;-)

BTW, we have found another -O0 + "omit-frame-pointer" regression with
gcc 13.1.0 on all architectures ("omit-frame-pointer" will be completely
ignored when -O0 passed whatever other internal optimize attribute like
'Os' we used together in commit '4dc4401991fc' for gcc < 11.1.0), Yuan
is doing more tests to confirm it, will open another discussion for it.

> Benefit from the __no_stack_protetor macro, we have no need to input
> __optimize__("-fno-stack-protector") for every new architecture, it may be the
> time to only use __optimize__("-fno-stack-protector"), am I missing something? 
> 
> > out that your willingness to work around some of the oddities met on
> > this one have resulted in a lot of drift away from the "keep it simple"
> > principle and significantly delayed the possibilities to integrate the
> > rest of your work. It would be much saner to only focus on ppc64/ppc64le
> > and figure later how to make ppc32 work (or decide not to support it if
> > it's not worth the effort in the end).
> 
> Another test shows, the run target of ppc64le with the big endian gcc 13.1.0
> toolchain has test startup failure (although we have verified run-user before,
> run-user ok! and run with local powerpc64le toolchain ok too!), I'm debugging
> this now, hope it not cost too much.

Just solved this, when -mabi=elfv2 supported by the toolchain (gcc
13.1.0 has this option), kernel will compile with this ABI, to align
with kernel, our user space application should use -mabi=elfv2 too if
toolchain support it, otherwise, test will simply fails at startup, this
solves it:

    $(call cc-option,-mabi=elfv2)

> 
> Another good news is, Yuan has found a working defconfig for ppc32 which has
> poweroff support and he is helping me narrowing down the exact options, this
> will eventually make us happy ;-)
>

We eventually find the missing poweroff option for ppc32, will update
the patches with them.

we also found such options for all of the nolibc supported
architectures, will add them in their tinyconfig support patches.

Thanks,
Zhangjin

> Thanks & Best regards,
> Zhangjin
> 
> > 
> > Regards,
> > willy

  reply	other threads:[~2023-08-02 16:04 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-01 19:36 [PATCH v4 00/12] tools/nolibc: add 32/64-bit powerpc support Zhangjin Wu
2023-08-01 19:37 ` [PATCH v4 01/12] tools/nolibc: add support for powerpc Zhangjin Wu
2023-08-01 19:38 ` [PATCH v4 02/12] tools/nolibc: add support for powerpc64 Zhangjin Wu
2023-08-01 19:39 ` [PATCH v4 03/12] selftests/nolibc: fix up O= option support Zhangjin Wu
2023-08-01 19:40 ` [PATCH v4 04/12] selftests/nolibc: add macros to reduce duplicated changes Zhangjin Wu
2023-08-01 19:41 ` [PATCH v4 05/12] selftests/nolibc: add XARCH and ARCH mapping support Zhangjin Wu
2023-08-01 19:42 ` [PATCH v4 06/12] selftests/nolibc: add nolibc-test-config target Zhangjin Wu
2023-08-01 19:43 ` [PATCH v4 07/12] selftests/nolibc: add help for " Zhangjin Wu
2023-08-01 19:44 ` [PATCH v4 08/12] selftests/nolibc: add test support for ppc Zhangjin Wu
2023-08-02  5:21   ` Zhangjin Wu
2023-08-02  7:48     ` Willy Tarreau
2023-08-02 10:32       ` Zhangjin Wu
2023-08-02 16:03         ` Zhangjin Wu [this message]
2023-08-02 21:36           ` Thomas Weißschuh
2023-08-03  2:05             ` Willy Tarreau
2023-08-03  2:58               ` Zhangjin Wu
2023-08-03  4:37                 ` Willy Tarreau
2023-08-03  7:51               ` Zhangjin Wu
2023-08-01 19:45 ` [PATCH v4 09/12] selftests/nolibc: add test support for ppc64le Zhangjin Wu
2023-08-01 19:46 ` [PATCH v4 10/12] selftests/nolibc: add test support for ppc64 Zhangjin Wu
2023-08-01 19:47 ` [PATCH v4 11/12] selftests/nolibc: allow customize CROSS_COMPILE by architecture Zhangjin Wu
2023-08-01 19:49 ` [PATCH v4 12/12] selftests/nolibc: customize CROSS_COMPILE for 32/64-bit powerpc Zhangjin Wu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230802160358.407890-1-falcon@tinylab.org \
    --to=falcon@tinylab.org \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=tanyuan@tinylab.org \
    --cc=thomas@t-8ch.de \
    --cc=w@1wt.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.