diff mbox

[FFmpeg-devel] x86inc: don't use read-only data sections on COFF targets

Message ID 20170626033215.6924-1-jamrial@gmail.com
State Accepted
Commit 4d62ee674699645c7b7105213e7d339665144069
Headers show

Commit Message

James Almer June 26, 2017, 3:32 a.m. UTC
Yasm:
src/libavfilter/x86/af_volume.asm:24: warning: Standard COFF does not support read-only data sections
src/libavfilter/x86/af_volume.asm:24: warning: Unrecognized qualifier `align'

Nasm:
src/libavfilter/x86/af_volume.asm:24: error: standard COFF does not support section alignment specification
src/libavutil/x86/x86inc.asm:92: ... from macro `SECTION_RODATA' defined here

Signed-off-by: James Almer <jamrial@gmail.com>
---
Untested.

 libavutil/x86/x86inc.asm | 2 ++
 1 file changed, 2 insertions(+)

Comments

Clément Bœsch June 27, 2017, 6:54 a.m. UTC | #1
On Mon, Jun 26, 2017 at 12:32:15AM -0300, James Almer wrote:
> Yasm:
> src/libavfilter/x86/af_volume.asm:24: warning: Standard COFF does not support read-only data sections
> src/libavfilter/x86/af_volume.asm:24: warning: Unrecognized qualifier `align'
> 
> Nasm:
> src/libavfilter/x86/af_volume.asm:24: error: standard COFF does not support section alignment specification
> src/libavutil/x86/x86inc.asm:92: ... from macro `SECTION_RODATA' defined here
> 
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
> Untested.
> 
>  libavutil/x86/x86inc.asm | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/libavutil/x86/x86inc.asm b/libavutil/x86/x86inc.asm
> index fa826e6d85..c4ec29bd9d 100644
> --- a/libavutil/x86/x86inc.asm
> +++ b/libavutil/x86/x86inc.asm
> @@ -88,6 +88,8 @@
>  %macro SECTION_RODATA 0-1 16
>      %ifidn __OUTPUT_FORMAT__,aout
>          section .text
> +    %elifidn __OUTPUT_FORMAT__,coff
> +        section .text
>      %else
>          SECTION .rodata align=%1
>      %endif


I can confirm it fixes the compilation on DJGPP FATE instance.

Side note: I just noticed the object dependencies are broken with nasm
(typically, x86inc.asm is not present in libavfilter/x86/af_volume.d).
James Almer June 27, 2017, 4 p.m. UTC | #2
On 6/27/2017 3:54 AM, Clément Bœsch wrote:
> On Mon, Jun 26, 2017 at 12:32:15AM -0300, James Almer wrote:
>> Yasm:
>> src/libavfilter/x86/af_volume.asm:24: warning: Standard COFF does not support read-only data sections
>> src/libavfilter/x86/af_volume.asm:24: warning: Unrecognized qualifier `align'
>>
>> Nasm:
>> src/libavfilter/x86/af_volume.asm:24: error: standard COFF does not support section alignment specification
>> src/libavutil/x86/x86inc.asm:92: ... from macro `SECTION_RODATA' defined here
>>
>> Signed-off-by: James Almer <jamrial@gmail.com>
>> ---
>> Untested.
>>
>>  libavutil/x86/x86inc.asm | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/libavutil/x86/x86inc.asm b/libavutil/x86/x86inc.asm
>> index fa826e6d85..c4ec29bd9d 100644
>> --- a/libavutil/x86/x86inc.asm
>> +++ b/libavutil/x86/x86inc.asm
>> @@ -88,6 +88,8 @@
>>  %macro SECTION_RODATA 0-1 16
>>      %ifidn __OUTPUT_FORMAT__,aout
>>          section .text
>> +    %elifidn __OUTPUT_FORMAT__,coff
>> +        section .text
>>      %else
>>          SECTION .rodata align=%1
>>      %endif
> 
> 
> I can confirm it fixes the compilation on DJGPP FATE instance.

Pushed, thanks.

> 
> Side note: I just noticed the object dependencies are broken with nasm
> (typically, x86inc.asm is not present in libavfilter/x86/af_volume.d).

Huh, you're right. It works as expected if you use -M -MF instead of
-MD, but that defeats the point of using the latter which was to create
the dep file alongside assembly in a single nasm call.
diff mbox

Patch

diff --git a/libavutil/x86/x86inc.asm b/libavutil/x86/x86inc.asm
index fa826e6d85..c4ec29bd9d 100644
--- a/libavutil/x86/x86inc.asm
+++ b/libavutil/x86/x86inc.asm
@@ -88,6 +88,8 @@ 
 %macro SECTION_RODATA 0-1 16
     %ifidn __OUTPUT_FORMAT__,aout
         section .text
+    %elifidn __OUTPUT_FORMAT__,coff
+        section .text
     %else
         SECTION .rodata align=%1
     %endif