On Wed, Apr 3, 2019 at 3:40 PM Nick Desaulniers <
ndesau...@google.com> wrote:
> Looks like the search code should just be `G950FXXU4CRK1`. I won't be
> able to untar the kernel sources until Friday when I'm back from
> travel.
Nevermind, Crostini is pretty sweet.
>
> >>>
> >>> Error log captured after "LD init/built-in.o stage"
> >>>
> >>> drivers/built-in.o: In function `displayport_full_link_training':
> >>> /home/vaughn/android/dream/drivers/video/fbdev/exynos/dpu/displayport_drv.c:403: undefined reference to `__bad_udelay'
Looks like:
```c
static int displayport_full_link_training(void)
{
...
u8 training_aux_rd_interval;
...
training_aux_rd_interval = val[0];
...
udelay((training_aux_rd_interval*4000)+400);
...
```
I've modified my test case to match, and can still only repro at -O0
or not passing any optimization flag.
> >>>
> >>> Someone mind helping me with this matter?
>
> Is this file per chance not being compiled with optimizations turned
> on? For example, this test case:
>
https://godbolt.org/z/p3senS
>
> Produces references to __bad_udelay at -O0, but not -O1, -Os, -Oz, or
> -O2, in the following Android prebuilts of Clang:
> prebuilts/clang/host/linux-x86/clang-r349610/bin/clang
> prebuilts/clang/host/linux-x86/clang-r349610b/bin/clang
> prebuilts/clang/host/linux-x86/clang-r353983b/bin/clang
>
> I suspect
https://android-review.googlesource.com/c/toolchain/clang/+/938496
> may help in this case. We'll be producing a r353983c build soon with
> that fix cherry picked.
>
> In the meantime, can you enable optimizations for that translation
> unit if they're not already? In particular, it's really easy to mess
> up/redefine KBUILD_CFLAGS in your subdir's Makefile, dropping -O2.
Ok, so it looks like your device config
(arch/arm64/configs/exynos8895-dreamlte_defconfig) sets:
CONFIG_OPTIMIZE_FOR_SIZE=y
which in the top level Makefile sets -Oz. (Note that we recently
reverted this upstream
https://lkml.org/lkml/2019/3/18/1110, I
*highly* recommend CONFIG_OPTIMIZE_FOR_PERFORMANCE=y unless you're
absolutely out of partition space, or have a better reason).
None of the intermediary Makefiles between the top level one and
drivers/video/fbdev/exynos/dpu/Makefile seen to mess with
KBUILD_CFLAGS.
As I'm remote, it's not easy for me to build this source. Can you
provide the output of:
$ ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu make CC=clang
drivers/video/fbdev/exynos/dpu/displayport_drv.o V=1
(particularly, I'm curious if any optimization flag is being passed).
--
Thanks,
~Nick Desaulniers