[edk2-devel] [PATCH] Platform/Loongson: Allow building with stack protector support

WANG Xuerui posted 1 patch 1 year ago
Failed in applying to current master (apply log)
Platform/Loongson/LoongArchQemuPkg/Loongson.dsc | 3 +++
1 file changed, 3 insertions(+)
[edk2-devel] [PATCH] Platform/Loongson: Allow building with stack protector support
Posted by WANG Xuerui 1 year ago
Some toolchains have stack protection enabled by default, so without the
appropriate library included the build will fail with missing symbols
during link.

Cc: Bibo Mao <maobibo@loongson.cn>
Cc: Xianglai li <lixianglai@loongson.cn>
Cc: Chao Li <lichao@loongson.cn>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: WANG Xuerui <git@xen0n.name>
---
 Platform/Loongson/LoongArchQemuPkg/Loongson.dsc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc b/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc
index d1162519cd..465e9229a2 100644
--- a/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc
+++ b/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc
@@ -95,6 +95,9 @@
   TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
 !endif
 
+  # For stack protector support
+  NULL                             | MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
+
   BaseLib                          | MdePkg/Library/BaseLib/BaseLib.inf
   SafeIntLib                       | MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
   TimeBaseLib                      | EmbeddedPkg/Library/TimeBaseLib/TimeBaseLib.inf
-- 
2.39.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100746): https://edk2.groups.io/g/devel/message/100746
Mute This Topic: https://groups.io/mt/97430342/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] Platform/Loongson: Allow building with stack protector support
Posted by xianglai 1 year ago
Reviewed-by: Xianglai Li <lixianglai@loongson.cn>

On 2023/3/5 下午12:40, WANG Xuerui wrote:
> Some toolchains have stack protection enabled by default, so without the
> appropriate library included the build will fail with missing symbols
> during link.
>
> Cc: Bibo Mao <maobibo@loongson.cn>
> Cc: Xianglai li <lixianglai@loongson.cn>
> Cc: Chao Li <lichao@loongson.cn>
> Cc: Leif Lindholm <quic_llindhol@quicinc.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Signed-off-by: WANG Xuerui <git@xen0n.name>
> ---
>   Platform/Loongson/LoongArchQemuPkg/Loongson.dsc | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc b/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc
> index d1162519cd..465e9229a2 100644
> --- a/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc
> +++ b/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc
> @@ -95,6 +95,9 @@
>     TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
>   !endif
>   
> +  # For stack protector support
> +  NULL                             | MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
> +
>     BaseLib                          | MdePkg/Library/BaseLib/BaseLib.inf
>     SafeIntLib                       | MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
>     TimeBaseLib                      | EmbeddedPkg/Library/TimeBaseLib/TimeBaseLib.inf


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100829): https://edk2.groups.io/g/devel/message/100829
Mute This Topic: https://groups.io/mt/97430342/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH] Platform/Loongson: Allow building with stack protector support
Posted by Chao Li 1 year ago
Hi Xuerui,

I and Xianglai have reviewed this change a few days ago, you can create 
a PR in the edk2-platforms repo.


Thanks,
Chao
在 2023/3/8 11:17, xianglai 写道:
>
> Reviewed-by: Xianglai Li <lixianglai@loongson.cn>
>
> On 2023/3/5 下午12:40, WANG Xuerui wrote:
>> Some toolchains have stack protection enabled by default, so without the
>> appropriate library included the build will fail with missing symbols
>> during link.
>>
>> Cc: Bibo Mao<maobibo@loongson.cn>
>> Cc: Xianglai li<lixianglai@loongson.cn>
>> Cc: Chao Li<lichao@loongson.cn>
>> Cc: Leif Lindholm<quic_llindhol@quicinc.com>
>> Cc: Michael D Kinney<michael.d.kinney@intel.com>
>> Signed-off-by: WANG Xuerui<git@xen0n.name>
>> ---
>>   Platform/Loongson/LoongArchQemuPkg/Loongson.dsc | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc b/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc
>> index d1162519cd..465e9229a2 100644
>> --- a/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc
>> +++ b/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc
>> @@ -95,6 +95,9 @@
>>     TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
>>   !endif
>>   
>> +  # For stack protector support
>> +  NULL                             | MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
>> +
>>     BaseLib                          | MdePkg/Library/BaseLib/BaseLib.inf
>>     SafeIntLib                       | MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
>>     TimeBaseLib                      | EmbeddedPkg/Library/TimeBaseLib/TimeBaseLib.inf
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101403): https://edk2.groups.io/g/devel/message/101403
Mute This Topic: https://groups.io/mt/97430342/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH] Platform/Loongson: Allow building with stack protector support
Posted by Chao Li 1 year ago
Reviewed-by: Chao Li <lichao@loongson.cn>


Thanks,
Chao
在 2023/3/5 12:40, WANG Xuerui 写道:
> Some toolchains have stack protection enabled by default, so without the
> appropriate library included the build will fail with missing symbols
> during link.
>
> Cc: Bibo Mao<maobibo@loongson.cn>
> Cc: Xianglai li<lixianglai@loongson.cn>
> Cc: Chao Li<lichao@loongson.cn>
> Cc: Leif Lindholm<quic_llindhol@quicinc.com>
> Cc: Michael D Kinney<michael.d.kinney@intel.com>
> Signed-off-by: WANG Xuerui<git@xen0n.name>
> ---
>   Platform/Loongson/LoongArchQemuPkg/Loongson.dsc | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc b/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc
> index d1162519cd..465e9229a2 100644
> --- a/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc
> +++ b/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc
> @@ -95,6 +95,9 @@
>     TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
>   !endif
>   
> +  # For stack protector support
> +  NULL                             | MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
> +
>     BaseLib                          | MdePkg/Library/BaseLib/BaseLib.inf
>     SafeIntLib                       | MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
>     TimeBaseLib                      | EmbeddedPkg/Library/TimeBaseLib/TimeBaseLib.inf


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100770): https://edk2.groups.io/g/devel/message/100770
Mute This Topic: https://groups.io/mt/97430342/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-