Skip to contentSkip to conversation

gpu/cuda: fix getenv related build error

PATCH Applied Levend Sayar 3 participants 5 messages Aug 3, 2023 – Oct 6, 2023 DRM drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpu/cuda: fix getenv related build error

If gdrapi.h is available, meson sets DRIVERS_GPU_CUDA_GDRCOPY_H as 1. This causes gdrcopy.c build to give an error;
because compiler can not find signature of getenv. stdlib.h is included for the definition of getenv function.

Fixes ca12f5e8a7db ("gpu/cuda: mark unused GDRCopy functions parameters")
---
 drivers/gpu/cuda/gdrcopy.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/cuda/gdrcopy.c +2 -0
index 322a5dbeb2..bd56b73ce4 100644
@@ -6,6 +6,8 @@
 
 #ifdef DRIVERS_GPU_CUDA_GDRCOPY_H
 
+#include <stdlib.h>
+
 static void *gdrclib;
 static gdr_t (*sym_gdr_open)(void);
 static int (*sym_gdr_pin_buffer)(gdr_t g, unsigned long addr, size_t size,
Signature · 1 line
2.39.2 (Apple Git-143)
#1 lore raw
Quoted 6 lines · Levend Sayar

If gdrapi.h is available, meson sets DRIVERS_GPU_CUDA_GDRCOPY_H as 1. This causes gdrcopy.c build to give an error;
because compiler can not find signature of getenv. stdlib.h is included for the definition of getenv function.

There was a bug report for this issue:
Bugzilla ID: 1133

Quoted 1 line
Fixes ca12f5e8a7db ("gpu/cuda: mark unused GDRCopy functions parameters")

It is probably worth backporting:
Cc: [email protected]

Quoted 2 lines

Elena, this is a quick one, review please.

Signature · 1 line
David Marchand
#2 lore raw

Sounds good to me

Thanks
EA

From: David Marchand <[email protected]>
Date: Friday, 29 September 2023 at 17:00
To: Elena Agostini <[email protected]>
Cc: [email protected] <[email protected]>, Levend Sayar <[email protected]>, Aaron Conole <[email protected]>, [email protected] <[email protected]>
Subject: Re: [PATCH] gpu/cuda: fix getenv related build error
External email: Use caution opening links or attachments

Quoted 6 lines · Levend Sayar

If gdrapi.h is available, meson sets DRIVERS_GPU_CUDA_GDRCOPY_H as 1. This causes gdrcopy.c build to give an error;
because compiler can not find signature of getenv. stdlib.h is included for the definition of getenv function.

There was a bug report for this issue:
Bugzilla ID: 1133

Quoted 1 line
Fixes ca12f5e8a7db ("gpu/cuda: mark unused GDRCopy functions parameters")

It is probably worth backporting:
Cc: [email protected]

Quoted 2 lines

Elena, this is a quick one, review please.

--
David Marchand

#3 lore raw
In reply to Levend Sayar
Quoted 9 lines · Levend Sayar

If gdrapi.h is available, meson sets DRIVERS_GPU_CUDA_GDRCOPY_H as 1. This causes gdrcopy.c build to give an error;
because compiler can not find signature of getenv. stdlib.h is included for the definition of getenv function.

Fixes ca12f5e8a7db ("gpu/cuda: mark unused GDRCopy functions parameters")

Applied, thanks Levend.

Signature · 1 line
David Marchand
#4 lore raw

My pleasure.
Thanks for ACKing Elena.
Thanks for applying David.

Best,
Levend

Quoted 19 lines · David Marchand
Quoted 9 lines · Levend Sayar

If gdrapi.h is available, meson sets DRIVERS_GPU_CUDA_GDRCOPY_H as 1. This causes gdrcopy.c build to give an error;
because compiler can not find signature of getenv. stdlib.h is included for the definition of getenv function.

Fixes ca12f5e8a7db ("gpu/cuda: mark unused GDRCopy functions parameters")

Applied, thanks Levend.

Signature · 1 line
David Marchand