security/masscan: fix build on armv7

- fix armv6/armv7 rdtsc patch
 - add a missing include file

 PR:		265567
 Approved by:	taguchi.ch AT gmail DOT com <maintainer>
This commit is contained in:
Robert Clausecker 2022-08-02 06:56:16 +02:00 committed by Neel Chauhan
parent c58b3d0f8b
commit e93cb96a07
2 changed files with 12 additions and 1 deletions

View file

@ -0,0 +1,10 @@
--- src/out-tcp-services.c.orig 2022-08-02 04:53:49 UTC
+++ src/out-tcp-services.c
@@ -1,6 +1,7 @@
#include "out-tcp-services.h"
#include <string.h>
#include <stdlib.h>
+#include <arpa/inet.h>
#ifndef WIN32
#include <netdb.h>

View file

@ -6,8 +6,9 @@
#include <machine/cpufunc.h>
-#define __rdtsc rdtsc
-#if (__ARM_ARCH >= 6) // V6 is the earliest arch that has a standard cyclecount
-unsigned long long rdtsc(void)
+#if (__ARM_ARCH >= 6 && __ARM_ARCH <= 7) // V6 is the earliest arch that has a standard cyclecount
unsigned long long rdtsc(void)
+unsigned long long __rdtsc(void)
{
uint32_t pmccntr;
uint32_t pmuseren;