Re: Snort3 fails to build for armv7 hardware

Bill - Google Account via Snort-devel <[email protected]> Tue, 23 Jul 2019 08:52:54 -0400
Newsgroups gmane.comp.security.ids.snort.devel
Message-ID <[email protected]>
This is a multipart message in MIME format.

--===============7331206596566022344==
Content-Type: multipart/alternative;
	boundary="----=_NextPart_000_002A_01D54134.049A3EE0"
Content-Language: en-us

This is a multipart message in MIME format.

------=_NextPart_000_002A_01D54134.049A3EE0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

Thanks Michael.  I've forwarded the patch and instructions to the pfSense
team for them to try on native ARM hardware.  I will let you know if it
works.

 

Bill Meeks

Vidalia, GA USA

 

From: Michael Altizer (mialtize) <[email protected]> 
Sent: Tuesday, July 23, 2019 12:30 AM
To: Bill - Google Account <[email protected]>;
[email protected]
Subject: Re: [Snort-devel] Snort3 fails to build for armv7 hardware

 

On 7/22/19 6:17 PM, Bill - Google Account via Snort-devel wrote:

Hi:

 

I maintain the Snort package for the pfSense firewall distribution.  I am
currently working on a Snort3 package for pfSense.  To that end the pfSense
developers have recently enabled the build of the Snort3 binary on their
image builders.  pfSense is based on FreeBSD and is available for both AMD64
and ARMv7 architectures.  Snort3-3.0.0-255 is currently failing to build for
ARMv7 images on FreeBSD 12.  The relevant parts of the build failure log are
as follows:

 

/nxb-bin/usr/bin/c++  -DHAVE_CONFIG_H -Dinline=inline -Drestrict=__restrict
-I/wrkdirs/usr/ports/security/snort3/work/snort3-3.0.0-255/src/network_inspe
ctors

-I/wrkdirs/usr/ports/security/snort3/work/snort3-3.0.0-255/src

-I/usr/local/include/luajit-2.1 -I.

-I/wrkdirs/usr/ports/security/snort3/work/snort3-3.0.0-255

-I/usr/local/include -O2 -pipe -DLIBICONV_PLUG -fno-strict-aliasing

-DLIBICONV_PLUG  -fvisibility=hidden   -DNDEBUG    -O2 -pipe

-DLIBICONV_PLUG -fno-strict-aliasing  -DLIBICONV_PLUG   -std=c++11 -MD

-MT src/time/CMakeFiles/time.dir/tsc_clock.cc.o -MF
src/time/CMakeFiles/time.dir/tsc_clock.cc.o.d -o
src/time/CMakeFiles/time.dir/tsc_clock.cc.o -c
/wrkdirs/usr/ports/security/snort3/work/snort3-3.0.0-255/src/time/tsc_clock.
cc

In file included from

/wrkdirs/usr/ports/security/snort3/work/snort3-3.0.0-255/src/time/tsc_clock.
cc:24:

/wrkdirs/usr/ports/security/snort3/work/snort3-3.0.0-255/src/time/tsc_clock.
h:55:32:

error: invalid output constraint '=a' in asm

        asm volatile("rdtsc" : "=a" (lo), "=d" (hi));

                               ^

1 error generated.

 

This error occurs on a stock FreeBSD 12.0 installation and is not specific
to pfSense.  Could someone from the Snort3 team please take a look?

 

Thanks,

 

Bill Meeks

Vidalia, GA USA

 

Try the attached patch.  Make sure you're building without
--enable-tsc-clock.


------=_NextPart_000_002A_01D54134.049A3EE0
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40"><head><meta =
http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii"><meta name=3DGenerator content=3D"Microsoft Word 15 =
(filtered medium)"><style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;
	color:black;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:#0563C1;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:#954F72;
	text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
	{mso-style-priority:99;
	mso-style-link:"Plain Text Char";
	margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;
	color:black;}
p.msonormal0, li.msonormal0, div.msonormal0
	{mso-style-name:msonormal;
	mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;
	color:black;}
span.PlainTextChar
	{mso-style-name:"Plain Text Char";
	mso-style-priority:99;
	mso-style-link:"Plain Text";
	font-family:"Calibri",sans-serif;}
span.EmailStyle20
	{mso-style-type:personal;
	font-family:"Calibri",sans-serif;
	color:windowtext;}
span.EmailStyle22
	{mso-style-type:personal-reply;
	font-family:"Calibri",sans-serif;
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]--></head><body bgcolor=3Dwhite =
lang=3DEN-US link=3D"#0563C1" vlink=3D"#954F72"><div =
class=3DWordSection1><p class=3DMsoNormal><span =
style=3D'color:windowtext'>Thanks Michael.&nbsp; I&#8217;ve forwarded =
the patch and instructions to the pfSense team for them to try on native =
ARM hardware.&nbsp; I will let you know if it =
works.<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'color:windowtext'><o:p>&nbsp;</o:p></span></p><div><p =
class=3DMsoNormal><b><i><span =
style=3D'font-size:12.0pt;color:#1F497D'>Bill =
Meeks<o:p></o:p></span></i></b></p><p class=3DMsoNormal><b><i><span =
style=3D'font-size:10.0pt;color:#1F497D'>Vidalia, GA =
USA</span></i></b><span =
style=3D'color:windowtext'><o:p></o:p></span></p></div><p =
class=3DMsoNormal><span =
style=3D'color:windowtext'><o:p>&nbsp;</o:p></span></p><div><div =
style=3D'border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in =
0in 0in'><p class=3DMsoNormal><b><span =
style=3D'color:windowtext'>From:</span></b><span =
style=3D'color:windowtext'> Michael Altizer (mialtize) =
&lt;[email protected]&gt; <br><b>Sent:</b> Tuesday, July 23, 2019 12:30 =
AM<br><b>To:</b> Bill - Google Account &lt;[email protected]&gt;; =
[email protected]<br><b>Subject:</b> Re: [Snort-devel] Snort3 =
fails to build for armv7 hardware<o:p></o:p></span></p></div></div><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><div><p class=3DMsoNormal>On =
7/22/19 6:17 PM, Bill - Google Account via Snort-devel =
wrote:<o:p></o:p></p></div><blockquote =
style=3D'margin-top:5.0pt;margin-bottom:5.0pt'><p =
class=3DMsoNormal>Hi:<o:p></o:p></p><p =
class=3DMsoNormal>&nbsp;<o:p></o:p></p><p class=3DMsoNormal>I maintain =
the Snort package for the pfSense firewall distribution.&nbsp; I am =
currently working on a Snort3 package for pfSense.&nbsp; To that end the =
pfSense developers have recently enabled the build of the Snort3 binary =
on their image builders.&nbsp; pfSense is based on FreeBSD and is =
available for both AMD64 and ARMv7 architectures.&nbsp; Snort3-3.0.0-255 =
is currently failing to build for ARMv7 images on FreeBSD 12.&nbsp; The =
relevant parts of the build failure log are as follows:<o:p></o:p></p><p =
class=3DMsoNormal>&nbsp;<o:p></o:p></p><p =
class=3DMsoPlainText>/nxb-bin/usr/bin/c++&nbsp; -DHAVE_CONFIG_H =
-Dinline=3Dinline -Drestrict=3D__restrict =
-I/wrkdirs/usr/ports/security/snort3/work/snort3-3.0.0-255/src/network_in=
spectors<o:p></o:p></p><p =
class=3DMsoPlainText>-I/wrkdirs/usr/ports/security/snort3/work/snort3-3.0=
.0-255/src<o:p></o:p></p><p =
class=3DMsoPlainText>-I/usr/local/include/luajit-2.1 =
-I.<o:p></o:p></p><p =
class=3DMsoPlainText>-I/wrkdirs/usr/ports/security/snort3/work/snort3-3.0=
.0-255<o:p></o:p></p><p class=3DMsoPlainText>-I/usr/local/include -O2 =
-pipe -DLIBICONV_PLUG -fno-strict-aliasing<o:p></o:p></p><p =
class=3DMsoPlainText>-DLIBICONV_PLUG&nbsp; =
-fvisibility=3Dhidden&nbsp;&nbsp; -DNDEBUG&nbsp;&nbsp; &nbsp;-O2 =
-pipe<o:p></o:p></p><p class=3DMsoPlainText>-DLIBICONV_PLUG =
-fno-strict-aliasing&nbsp; -DLIBICONV_PLUG&nbsp;&nbsp; -std=3Dc++11 =
-MD<o:p></o:p></p><p class=3DMsoPlainText>-MT =
src/time/CMakeFiles/time.dir/tsc_clock.cc.o -MF =
src/time/CMakeFiles/time.dir/tsc_clock.cc.o.d -o =
src/time/CMakeFiles/time.dir/tsc_clock.cc.o -c =
/wrkdirs/usr/ports/security/snort3/work/snort3-3.0.0-255/src/time/tsc_clo=
ck.cc<o:p></o:p></p><p class=3DMsoPlainText>In file included =
from<o:p></o:p></p><p =
class=3DMsoPlainText>/wrkdirs/usr/ports/security/snort3/work/snort3-3.0.0=
-255/src/time/tsc_clock.cc:24:<o:p></o:p></p><p =
class=3DMsoPlainText>/wrkdirs/usr/ports/security/snort3/work/snort3-3.0.0=
-255/src/time/tsc_clock.h:55:32:<o:p></o:p></p><p =
class=3DMsoPlainText>error: invalid output constraint '=3Da' in =
asm<o:p></o:p></p><p =
class=3DMsoPlainText>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; asm =
volatile(&quot;rdtsc&quot; : &quot;=3Da&quot; (lo), &quot;=3Dd&quot; =
(hi));<o:p></o:p></p><p =
class=3DMsoPlainText>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
^<o:p></o:p></p><p class=3DMsoPlainText>1 error =
generated.<o:p></o:p></p><p class=3DMsoNormal>&nbsp;<o:p></o:p></p><p =
class=3DMsoNormal>This error occurs on a stock FreeBSD 12.0 installation =
and is not specific to pfSense.&nbsp; Could someone from the Snort3 team =
please take a look?<o:p></o:p></p><p =
class=3DMsoNormal>&nbsp;<o:p></o:p></p><p =
class=3DMsoNormal>Thanks,<o:p></o:p></p><p =
class=3DMsoNormal>&nbsp;<o:p></o:p></p><p class=3DMsoNormal><b><i><span =
style=3D'font-size:12.0pt;color:#1F497D'>Bill =
Meeks</span></i></b><o:p></o:p></p><p class=3DMsoNormal><b><i><span =
style=3D'font-size:10.0pt;color:#1F497D'>Vidalia, GA =
USA</span></i></b><o:p></o:p></p></blockquote><p><o:p>&nbsp;</o:p></p><p>=
Try the attached patch.&nbsp; Make sure you're building without =
--enable-tsc-clock.<o:p></o:p></p></div></body></html>
------=_NextPart_000_002A_01D54134.049A3EE0--


--===============7331206596566022344==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Snort-devel mailing list
[email protected]
https://lists.snort.org/mailman/listinfo/snort-devel

Please visit http://blog.snort.org for the latest news about Snort!

--===============7331206596566022344==--