[Buildroot] [PATCH 1/1] package/sdl2: Fix Raspberry Pi support in package SDL2

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Thu Jan 18 15:05:14 UTC 2018


Hello,

Thanks for respining! It looks much better, but there's still one thing
I'm not sure is very good. See below.

On Thu, 18 Jan 2018 00:15:28 -0800, Guillermo A. Amaral wrote:

> ++#if SDL_VIDEO_DRIVER_RPI
> ++    path = SDL_getenv("LD_LIBRARY_PATH");
> ++    if (path) {
> ++        const int path_size = SDL_strlen(path) + 1 + sizeof(g_rpi_opt_path);
> ++        char *new_path = SDL_calloc(1, path_size);
> ++        strcat(new_path, path);
> ++        strcat(new_path, ":");
> ++        strcat(new_path, g_rpi_opt_path);
> ++        SDL_setenv("LD_LIBRARY_PATH", new_path, 1);
> ++        SDL_free(new_path);
> ++    } else {
> ++        SDL_setenv("LD_LIBRARY_PATH", g_rpi_opt_path, 1);
> ++    }
> ++    path = NULL;

Yerk, upstream has accepted this? To me, it looks really terrible to
set LD_LIBRARY_PATH from within a program. Is it really considered a
good practice ?

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


More information about the buildroot mailing list