On Sun, Sep 03, 2017 at 08:30:24PM +0200, Michael Niedermayer wrote:
> On Sat, Sep 02, 2017 at 08:17:40PM +0200, Clément Bœsch wrote:
> > From: Clément Bœsch <cboe...@gopro.com>
> > 
> > Refer to "checkasm: use perf API on Linux ARM*" commit for the
> > rationale.
> > 
> > The implementation is somehow duplicated with checkasm, but so is the
> > current usage of AV_READ_TIME(). Until these implementations and
> > heuristics are made consistent, I don't see a way of sharing that code.
> > 
> > Note: when using libavutil/timer.h, it is now important to include
> > before any other include due to the _GNU_SOURCE requirement.
> > ---
> >  libavutil/timer.h | 46 +++++++++++++++++++++++++++++++++++++++++++---
> >  1 file changed, 43 insertions(+), 3 deletions(-)
> 
> this breaks building   testprogs on qemu arm:
> 
> src/libavutil/tests/base64.c: In function ‘main’:
> src/libavutil/tests/base64.c:105:159: error: implicit declaration of function 
> ‘syscall’ [-Werror=implicit-function-declaration]
> cc1: some warnings being treated as errors
> make: *** [libavutil/tests/base64.o] Error 1
> make: *** Waiting for unfinished jobs....
> src/libavutil/tests/adler32.c: In function ‘main’:
> src/libavutil/tests/adler32.c:42:159: error: implicit declaration of function 
> ‘syscall’ [-Werror=implicit-function-declaration]
> cc1: some warnings being treated as errors
> make: *** [libavutil/tests/adler32.o] Error 1
> src/libavutil/tests/aes.c: In function ‘main’:
> src/libavutil/tests/aes.c:94:163: error: implicit declaration of function 
> ‘syscall’ [-Werror=implicit-function-declaration]
> cc1: some warnings being treated as errors
> make: *** [libavutil/tests/aes.o] Error 1
> src/libavformat/utils.c: In function 
> ‘avformat_transfer_internal_stream_timing_info’:
> src/libavformat/utils.c:5537:5: warning: ‘codec’ is deprecated (declared at 
> src/libavformat/avformat.h:893) [-Wdeprecated-declarations]
> src/libavformat/utils.c:5538:5: warning: ‘codec’ is deprecated (declared at 
> src/libavformat/avformat.h:893) [-Wdeprecated-declarations]
> 

Fixed in my branch (https://github.com/ubitux/FFmpeg/compare/perf)

Also attaching to this mail the two patches fixing this.

Thanks.

-- 
Clément B.
From 110a9025bdcb96f498a8c9728ff2b7de15f7a990 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= <cboe...@gopro.com>
Date: Thu, 7 Sep 2017 15:56:56 +0200
Subject: [PATCH 3/5] lavu/tests/des: rename crypt to crypt_ref

This will prevent a symbol clash with crypt(3) after unistd.h is
included.
---
 libavutil/tests/des.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavutil/tests/des.c b/libavutil/tests/des.c
index 309be29473..eac33d47d4 100644
--- a/libavutil/tests/des.c
+++ b/libavutil/tests/des.c
@@ -34,7 +34,7 @@ static uint64_t rand64(void)
 
 static const uint8_t test_key[] = { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0 };
 static const DECLARE_ALIGNED(8, uint8_t, plain)[] = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 };
-static const DECLARE_ALIGNED(8, uint8_t, crypt)[] = { 0x4a, 0xb6, 0x5b, 0x3d, 0x4b, 0x06, 0x15, 0x18 };
+static const DECLARE_ALIGNED(8, uint8_t, crypt_ref)[] = { 0x4a, 0xb6, 0x5b, 0x3d, 0x4b, 0x06, 0x15, 0x18 };
 static DECLARE_ALIGNED(8, uint8_t, tmp)[8];
 static DECLARE_ALIGNED(8, uint8_t, large_buffer)[10002][8];
 static const uint8_t cbc_key[] = {
@@ -82,13 +82,13 @@ int main(void)
     key[0].word = AV_RB64(test_key);
     data.word   = AV_RB64(plain);
     gen_roundkeys(roundkeys, key[0].word);
-    if (des_encdec(data.word, roundkeys, 0) != AV_RB64(crypt)) {
+    if (des_encdec(data.word, roundkeys, 0) != AV_RB64(crypt_ref)) {
         printf("Test 1 failed\n");
         return 1;
     }
     av_des_init(&d, test_key, 64, 0);
     av_des_crypt(&d, tmp, plain, 1, NULL, 0);
-    if (memcmp(tmp, crypt, sizeof(crypt))) {
+    if (memcmp(tmp, crypt_ref, sizeof(crypt_ref))) {
         printf("Public API decryption failed\n");
         return 1;
     }
-- 
2.14.1

From c5173492fecd1badafdd959987e996f5ca5d64c1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= <cboe...@gopro.com>
Date: Thu, 7 Sep 2017 15:52:47 +0200
Subject: [PATCH 4/5] lavu/tests: move timer.h include earlier

In the next commit, timer.h will require a _GNU_SOURCE to be set before
including system headers. This commit prevents compilation failures.
---
 libavutil/tests/adler32.c   | 4 +++-
 libavutil/tests/aes.c       | 3 +++
 libavutil/tests/base64.c    | 4 +++-
 libavutil/tests/des.c       | 2 ++
 libavutil/tests/eval.c      | 3 ++-
 libavutil/tests/softfloat.c | 2 ++
 6 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/libavutil/tests/adler32.c b/libavutil/tests/adler32.c
index 511bf1e401..13f760b477 100644
--- a/libavutil/tests/adler32.c
+++ b/libavutil/tests/adler32.c
@@ -17,10 +17,12 @@
  */
 
 // LCOV_EXCL_START
+
+#include "libavutil/timer.h"
+
 #include <string.h>
 
 #include "libavutil/log.h"
-#include "libavutil/timer.h"
 #include "libavutil/adler32.h"
 
 #define LEN 7001
diff --git a/libavutil/tests/aes.c b/libavutil/tests/aes.c
index 1291ad6633..c7f842c1c7 100644
--- a/libavutil/tests/aes.c
+++ b/libavutil/tests/aes.c
@@ -17,6 +17,9 @@
  */
 
 // LCOV_EXCL_START
+
+#include "libavutil/timer.h"
+
 #include <string.h>
 
 #include "libavutil/aes.h"
diff --git a/libavutil/tests/base64.c b/libavutil/tests/base64.c
index 88fd55c220..400e01cefe 100644
--- a/libavutil/tests/base64.c
+++ b/libavutil/tests/base64.c
@@ -17,12 +17,14 @@
  */
 
 // LCOV_EXCL_START
+
+#include "libavutil/timer.h"
+
 #include <stdint.h>
 #include <stdio.h>
 
 #include "libavutil/common.h"
 #include "libavutil/base64.h"
-#include "libavutil/timer.h"
 
 #define MAX_DATA_SIZE    1024
 #define MAX_ENCODED_SIZE 2048
diff --git a/libavutil/tests/des.c b/libavutil/tests/des.c
index eac33d47d4..f2a5c34f1a 100644
--- a/libavutil/tests/des.c
+++ b/libavutil/tests/des.c
@@ -16,6 +16,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/timer.h"
+
 #include "libavutil/des.c"
 
 #include <stdint.h>
diff --git a/libavutil/tests/eval.c b/libavutil/tests/eval.c
index 2a1afcc4dc..b64c6d635d 100644
--- a/libavutil/tests/eval.c
+++ b/libavutil/tests/eval.c
@@ -16,12 +16,13 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/timer.h"
+
 #include <math.h>
 #include <stdio.h>
 #include <string.h>
 
 #include "libavutil/libm.h"
-#include "libavutil/timer.h"
 #include "libavutil/eval.h"
 
 static const double const_values[] = {
diff --git a/libavutil/tests/softfloat.c b/libavutil/tests/softfloat.c
index 16788d4da9..c06de44933 100644
--- a/libavutil/tests/softfloat.c
+++ b/libavutil/tests/softfloat.c
@@ -18,6 +18,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/timer.h"
+
 #include <inttypes.h>
 
 #include "libavutil/softfloat.h"
-- 
2.14.1

Attachment: signature.asc
Description: PGP signature

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to