[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] fs: remove implicit compiler calls to memset/memcpy

From: Vladimir 'phcoder' Serbinenko
Subject: Re: [PATCH] fs: remove implicit compiler calls to memset/memcpy
Date: Mon, 18 Apr 2016 05:50:59 +0000

You can use asm to get around msvc limitations. Sth like

.global memcpy
      jmp grub_memcpy

Where implicit memcpy is inserted is pretty much unpredictable and we're not going to maintain memcpy-free environment because of this

Le Mon, Apr 11, 2016 à 1:50 AM, Pete Batard <address@hidden> a écrit :
On 2016.04.10 16:30, Vladimir 'phcoder' Serbinenko wrote:
> Why is the same solution not suitable for you?

That's the first thing I attempted, but the MSVC compiler is uncooperative.

If you try to redefine memset/memcpy, you get the following compiler error:

error C2169: '_memcpy' : Intrinsic function, cannot be defined

And of course, this means that you then have to link with the standard
Windows MSVC libraries, which creates issues when building UEFI drivers...

Apparently, there used to be a way to disable intrinsic functions with
older versions of Visual Studio (using a pragma), but this capability
was removed in the latest versions. Either that, or Microsoft does not
consider memcpy and friends as belonging to the general "intrinsic"
category that the compiler can disable.

This means that, right now, the only option available is to patch the
GRUB source.



Grub-devel mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]