Make stdlib/testmb compile when _FORTIFY_SOURCE is not predefined 2

Message ID 20230127194815.1923085-1-dilfridge@gentoo.org
State Committed
Commit 35bcb08eaa953c9b8bef6ab2486dc4361e1f26c0
Headers
Series Make stdlib/testmb compile when _FORTIFY_SOURCE is not predefined 2 |

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent
dj/TryBot-32bit success Build for i686

Commit Message

Andreas K. Huettel Jan. 27, 2023, 7:48 p.m. UTC
  Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
---
 stdlib/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Siddhesh Poyarekar Jan. 27, 2023, 8:30 p.m. UTC | #1
On 2023-01-27 14:48, Andreas K. Hüttel via Libc-alpha wrote:
> Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
> ---

Sam had posted this exact same patch ~6 months ago:

https://patchwork.sourceware.org/project/glibc/patch/20220805201358.2348750-1-sam@gentoo.org/

We had agreed then to use the result of libc_cv_predef_fortify_source 
then, maybe tweaking that check to find the fortification level and 
passing it here.  But maybe that's too much engineering for this little 
test.

I'm OK with this change as is; Sam, could you please push your patch 
after Carlos is done with the 2.37 release?

Thanks,
Sid

LGTM.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>

>   stdlib/Makefile | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/stdlib/Makefile b/stdlib/Makefile
> index e0fc82fc4d..83391d00c1 100644
> --- a/stdlib/Makefile
> +++ b/stdlib/Makefile
> @@ -392,7 +392,7 @@ CFLAGS-tst-qsort.c += $(stack-align-test-flags)
>   CFLAGS-tst-makecontext.c += -funwind-tables
>   CFLAGS-tst-makecontext2.c += $(stack-align-test-flags)
>   
> -CFLAGS-testmb.c += -D_FORTIFY_SOURCE=2 -Wall -Werror
> +CFLAGS-testmb.c += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wall -Werror
>   
>   
>   # Run a test on the header files we use.
  
Andreas K. Huettel Jan. 27, 2023, 11:45 p.m. UTC | #2
> 
> I'm OK with this change as is; Sam, could you please push your patch 
> after Carlos is done with the 2.37 release?
> 

Neither Sam nor me can push... :)
  
Siddhesh Poyarekar Jan. 28, 2023, 1:02 a.m. UTC | #3
On 2023-01-27 18:45, Andreas K. Huettel wrote:
>>
>> I'm OK with this change as is; Sam, could you please push your patch
>> after Carlos is done with the 2.37 release?
>>
> 
> Neither Sam nor me can push... :)
> 

Ahh! In that case I'll remember to push as soon as Carlos is done 
cutting the release next week :)

Sid
  

Patch

diff --git a/stdlib/Makefile b/stdlib/Makefile
index e0fc82fc4d..83391d00c1 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -392,7 +392,7 @@  CFLAGS-tst-qsort.c += $(stack-align-test-flags)
 CFLAGS-tst-makecontext.c += -funwind-tables
 CFLAGS-tst-makecontext2.c += $(stack-align-test-flags)
 
-CFLAGS-testmb.c += -D_FORTIFY_SOURCE=2 -Wall -Werror
+CFLAGS-testmb.c += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wall -Werror
 
 
 # Run a test on the header files we use.