diff mbox series

[v4,09/29] makefile: add mbedtls include directories

Message ID 20240702182325.2904421-10-raymond.mao@linaro.org
State Changes Requested
Delegated to: Tom Rini
Headers show
Series Integrate MbedTLS v3.6 LTS with U-Boot | expand

Commit Message

Raymond Mao July 2, 2024, 6:22 p.m. UTC
Add the mbedtls include directories into the build system.

Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
---
Changes in v2
- None.
Changes in v3
- Remove changes for PLATFORM_CPPFLAGS.
Changes in v4
- Fix errors when building without "O=".
- Minor fix of the include directories.

 Makefile | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Ilias Apalodimas July 3, 2024, 11:34 a.m. UTC | #1
On Tue, 2 Jul 2024 at 21:27, Raymond Mao <raymond.mao@linaro.org> wrote:
>
> Add the mbedtls include directories into the build system.
>
> Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
> ---
> Changes in v2
> - None.
> Changes in v3
> - Remove changes for PLATFORM_CPPFLAGS.
> Changes in v4
> - Fix errors when building without "O=".
> - Minor fix of the include directories.
>
>  Makefile | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/Makefile b/Makefile
> index 07d7947c8af..fd855dbd5c9 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -829,6 +829,12 @@ KBUILD_HOSTCFLAGS += $(if $(CONFIG_TOOLS_DEBUG),-g)
>  UBOOTINCLUDE    := \
>         -Iinclude \
>         $(if $(KBUILD_SRC), -I$(srctree)/include) \
> +       $(if $(CONFIG_MBEDTLS_LIB), \
> +               "-DMBEDTLS_CONFIG_FILE=\"mbedtls_def_config.h\"" \

don't you need a full path to the config file?
> +               -I$(srctree)/lib/mbedtls \
> +               -I$(srctree)/lib/mbedtls/port \
> +               -I$(srctree)/lib/mbedtls/external/mbedtls \
> +               -I$(srctree)/lib/mbedtls/external/mbedtls/include) \

Most of these paths are explicitly added in patch #3. Why don't we
just keep them there?

Thanks
/Ilias
>         $(if $(CONFIG_$(SPL_)SYS_THUMB_BUILD), \
>                 $(if $(CONFIG_HAS_THUMB2), \
>                         $(if $(CONFIG_CPU_V7M), \
> --
> 2.25.1
>
Raymond Mao July 18, 2024, 8:01 p.m. UTC | #2
Hi Ilias,

On Wed, 3 Jul 2024 at 07:35, Ilias Apalodimas <ilias.apalodimas@linaro.org>
wrote:

> On Tue, 2 Jul 2024 at 21:27, Raymond Mao <raymond.mao@linaro.org> wrote:
> >
> > Add the mbedtls include directories into the build system.
> >
> > Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
> > ---
> > Changes in v2
> > - None.
> > Changes in v3
> > - Remove changes for PLATFORM_CPPFLAGS.
> > Changes in v4
> > - Fix errors when building without "O=".
> > - Minor fix of the include directories.
> >
> >  Makefile | 6 ++++++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/Makefile b/Makefile
> > index 07d7947c8af..fd855dbd5c9 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -829,6 +829,12 @@ KBUILD_HOSTCFLAGS += $(if $(CONFIG_TOOLS_DEBUG),-g)
> >  UBOOTINCLUDE    := \
> >         -Iinclude \
> >         $(if $(KBUILD_SRC), -I$(srctree)/include) \
> > +       $(if $(CONFIG_MBEDTLS_LIB), \
> > +               "-DMBEDTLS_CONFIG_FILE=\"mbedtls_def_config.h\"" \
>
> don't you need a full path to the config file?
> > +               -I$(srctree)/lib/mbedtls \
> > +               -I$(srctree)/lib/mbedtls/port \
> > +               -I$(srctree)/lib/mbedtls/external/mbedtls \
> > +               -I$(srctree)/lib/mbedtls/external/mbedtls/include) \
>
> Most of these paths are explicitly added in patch #3. Why don't we
> just keep them there?
>
> We still need this for building other modules other than the MbedTLS
library itself.
For example, when those files include the "hash-checksum.h".

Regards,
Raymond
Raymond Mao July 18, 2024, 8:12 p.m. UTC | #3
Hi Ilias,

On Wed, 3 Jul 2024 at 07:35, Ilias Apalodimas <ilias.apalodimas@linaro.org>
wrote:

> On Tue, 2 Jul 2024 at 21:27, Raymond Mao <raymond.mao@linaro.org> wrote:
> >
> > Add the mbedtls include directories into the build system.
> >
> > Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
> > ---
> > Changes in v2
> > - None.
> > Changes in v3
> > - Remove changes for PLATFORM_CPPFLAGS.
> > Changes in v4
> > - Fix errors when building without "O=".
> > - Minor fix of the include directories.
> >
> >  Makefile | 6 ++++++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/Makefile b/Makefile
> > index 07d7947c8af..fd855dbd5c9 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -829,6 +829,12 @@ KBUILD_HOSTCFLAGS += $(if $(CONFIG_TOOLS_DEBUG),-g)
> >  UBOOTINCLUDE    := \
> >         -Iinclude \
> >         $(if $(KBUILD_SRC), -I$(srctree)/include) \
> > +       $(if $(CONFIG_MBEDTLS_LIB), \
> > +               "-DMBEDTLS_CONFIG_FILE=\"mbedtls_def_config.h\"" \
>
> don't you need a full path to the config file?
>
No, we don't need the full path.
Since "$(srctree)/lib/mbedtls" is in the include directories, and the this
filename is unique
in the project.

Regards,
Raymond
Ilias Apalodimas July 23, 2024, 7:44 a.m. UTC | #4
On Thu, 18 Jul 2024 at 23:12, Raymond Mao <raymond.mao@linaro.org> wrote:
>
> Hi Ilias,
>
> On Wed, 3 Jul 2024 at 07:35, Ilias Apalodimas <ilias.apalodimas@linaro.org> wrote:
>>
>> On Tue, 2 Jul 2024 at 21:27, Raymond Mao <raymond.mao@linaro.org> wrote:
>> >
>> > Add the mbedtls include directories into the build system.
>> >
>> > Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
>> > ---
>> > Changes in v2
>> > - None.
>> > Changes in v3
>> > - Remove changes for PLATFORM_CPPFLAGS.
>> > Changes in v4
>> > - Fix errors when building without "O=".
>> > - Minor fix of the include directories.
>> >
>> >  Makefile | 6 ++++++
>> >  1 file changed, 6 insertions(+)
>> >
>> > diff --git a/Makefile b/Makefile
>> > index 07d7947c8af..fd855dbd5c9 100644
>> > --- a/Makefile
>> > +++ b/Makefile
>> > @@ -829,6 +829,12 @@ KBUILD_HOSTCFLAGS += $(if $(CONFIG_TOOLS_DEBUG),-g)
>> >  UBOOTINCLUDE    := \
>> >         -Iinclude \
>> >         $(if $(KBUILD_SRC), -I$(srctree)/include) \
>> > +       $(if $(CONFIG_MBEDTLS_LIB), \
>> > +               "-DMBEDTLS_CONFIG_FILE=\"mbedtls_def_config.h\"" \
>>
>> don't you need a full path to the config file?
>
> No, we don't need the full path.
> Since "$(srctree)/lib/mbedtls" is in the include directories, and the this filename is unique
> in the project.
>

Then why are they needed on patch #3? Don't we include them already in
the generic Makefile?

Cheers
/Ilias
> Regards,
> Raymond
Raymond Mao July 23, 2024, 5:05 p.m. UTC | #5
Hi Ilias,

On Tue, 23 Jul 2024 at 03:45, Ilias Apalodimas <ilias.apalodimas@linaro.org>
wrote:

> On Thu, 18 Jul 2024 at 23:12, Raymond Mao <raymond.mao@linaro.org> wrote:
> >
> > Hi Ilias,
> >
> > On Wed, 3 Jul 2024 at 07:35, Ilias Apalodimas <
> ilias.apalodimas@linaro.org> wrote:
> >>
> >> On Tue, 2 Jul 2024 at 21:27, Raymond Mao <raymond.mao@linaro.org>
> wrote:
> >> >
> >> > Add the mbedtls include directories into the build system.
> >> >
> >> > Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
> >> > ---
> >> > Changes in v2
> >> > - None.
> >> > Changes in v3
> >> > - Remove changes for PLATFORM_CPPFLAGS.
> >> > Changes in v4
> >> > - Fix errors when building without "O=".
> >> > - Minor fix of the include directories.
> >> >
> >> >  Makefile | 6 ++++++
> >> >  1 file changed, 6 insertions(+)
> >> >
> >> > diff --git a/Makefile b/Makefile
> >> > index 07d7947c8af..fd855dbd5c9 100644
> >> > --- a/Makefile
> >> > +++ b/Makefile
> >> > @@ -829,6 +829,12 @@ KBUILD_HOSTCFLAGS += $(if
> $(CONFIG_TOOLS_DEBUG),-g)
> >> >  UBOOTINCLUDE    := \
> >> >         -Iinclude \
> >> >         $(if $(KBUILD_SRC), -I$(srctree)/include) \
> >> > +       $(if $(CONFIG_MBEDTLS_LIB), \
> >> > +               "-DMBEDTLS_CONFIG_FILE=\"mbedtls_def_config.h\"" \
> >>
> >> don't you need a full path to the config file?
> >
> > No, we don't need the full path.
> > Since "$(srctree)/lib/mbedtls" is in the include directories, and the
> this filename is unique
> > in the project.
> >
>
> Then why are they needed on patch #3? Don't we include them already in
> the generic Makefile?
>
> I will remove the ones from #3, and then squash this patch with #3.

Regards,
Raymond
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 07d7947c8af..fd855dbd5c9 100644
--- a/Makefile
+++ b/Makefile
@@ -829,6 +829,12 @@  KBUILD_HOSTCFLAGS += $(if $(CONFIG_TOOLS_DEBUG),-g)
 UBOOTINCLUDE    := \
 	-Iinclude \
 	$(if $(KBUILD_SRC), -I$(srctree)/include) \
+	$(if $(CONFIG_MBEDTLS_LIB), \
+		"-DMBEDTLS_CONFIG_FILE=\"mbedtls_def_config.h\"" \
+		-I$(srctree)/lib/mbedtls \
+		-I$(srctree)/lib/mbedtls/port \
+		-I$(srctree)/lib/mbedtls/external/mbedtls \
+		-I$(srctree)/lib/mbedtls/external/mbedtls/include) \
 	$(if $(CONFIG_$(SPL_)SYS_THUMB_BUILD), \
 		$(if $(CONFIG_HAS_THUMB2), \
 			$(if $(CONFIG_CPU_V7M), \