Re: Snort3 fails to build for armv7 hardware

"Michael Altizer \(mialtize\) via Snort-devel" <[email protected]> Tue, 23 Jul 2019 04:30:12 +0000
Newsgroups gmane.comp.security.ids.snort.devel
Message-ID <[email protected]>
--_004_b4684f4775a63974d167c02c8d8ec760ciscocom_
Content-Type: multipart/alternative;
	boundary="_000_b4684f4775a63974d167c02c8d8ec760ciscocom_"

--_000_b4684f4775a63974d167c02c8d8ec760ciscocom_
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

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 c=
urrently working on a Snort3 package for pfSense.  To that end the pfSense =
developers have recently enabled the build of the Snort3 binary on their im=
age 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 fo=
r 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=3Dinline -Drestrict=3D__rest=
rict -I/wrkdirs/usr/ports/security/snort3/work/snort3-3.0.0-255/src/network=
_inspectors

-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=3Dhidden   -DNDEBUG    -O2 -pipe

-DLIBICONV_PLUG -fno-strict-aliasing  -DLIBICONV_PLUG   -std=3Dc++11 -MD

-MT src/time/CMakeFiles/time.dir/tsc_clock.cc.o -MF src/time/CMakeFiles/tim=
e.dir/tsc_clock.cc.o.d -o src/time/CMakeFiles/time.dir/tsc_clock.cc.o -c /w=
rkdirs/usr/ports/security/snort3/work/snort3-3.0.0-255/src/time/tsc_clock.c=
c

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 '=3Da' in asm

        asm volatile("rdtsc" : "=3Da" (lo), "=3Dd" (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-clo=
ck.

--_000_b4684f4775a63974d167c02c8d8ec760ciscocom_
Content-Type: text/html; charset="Windows-1252"
Content-ID: <[email protected]>
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DWindows-1=
252">
</head>
<body text=3D"#000000" bgcolor=3D"#FFFFFF">
<div class=3D"moz-cite-prefix">On 7/22/19 6:17 PM, Bill - Google Account vi=
a Snort-devel wrote:<br>
</div>
<blockquote type=3D"cite" cite=3D"mid:000801d540db$4f7375c0$ee5a6140$@gmail=
.com">
<meta name=3D"Generator" 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;}
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;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri",sans-serif;
	color:windowtext;}
span.PlainTextChar
	{mso-style-name:"Plain Text Char";
	mso-style-priority:99;
	mso-style-link:"Plain Text";
	font-family:"Calibri",sans-serif;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri",sans-serif;}
@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]-->
<div class=3D"WordSection1">
<p class=3D"MsoNormal">Hi:<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">I maintain the Snort package for the pfSense firewal=
l distribution.&nbsp; I am currently working on a Snort3 package for pfSens=
e.&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 arch=
itectures.&nbsp; Snort3-3.0.0-255 is currently failing to build for ARMv7 i=
mages on FreeBSD 12.&nbsp; The relevant parts of the build failure log are =
as follows:<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoPlainText">/nxb-bin/usr/bin/c&#43;&#43;&nbsp; -DHAVE_CONFIG_=
H -Dinline=3Dinline -Drestrict=3D__restrict -I/wrkdirs/usr/ports/security/s=
nort3/work/snort3-3.0.0-255/src/network_inspectors<o:p></o:p></p>
<p class=3D"MsoPlainText">-I/wrkdirs/usr/ports/security/snort3/work/snort3-=
3.0.0-255/src<o:p></o:p></p>
<p class=3D"MsoPlainText">-I/usr/local/include/luajit-2.1 -I.<o:p></o:p></p=
>
<p class=3D"MsoPlainText">-I/wrkdirs/usr/ports/security/snort3/work/snort3-=
3.0.0-255<o:p></o:p></p>
<p class=3D"MsoPlainText">-I/usr/local/include -O2 -pipe -DLIBICONV_PLUG -f=
no-strict-aliasing<o:p></o:p></p>
<p class=3D"MsoPlainText">-DLIBICONV_PLUG&nbsp; -fvisibility=3Dhidden&nbsp;=
&nbsp; -DNDEBUG&nbsp;&nbsp; &nbsp;-O2 -pipe<o:p></o:p></p>
<p class=3D"MsoPlainText">-DLIBICONV_PLUG -fno-strict-aliasing&nbsp; -DLIBI=
CONV_PLUG&nbsp;&nbsp; -std=3Dc&#43;&#43;11 -MD<o:p></o:p></p>
<p class=3D"MsoPlainText">-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/tim=
e.dir/tsc_clock.cc.o -c /wrkdirs/usr/ports/security/snort3/work/snort3-3.0.=
0-255/src/time/tsc_clock.cc<o:p></o:p></p>
<p class=3D"MsoPlainText">In file included from<o:p></o:p></p>
<p class=3D"MsoPlainText">/wrkdirs/usr/ports/security/snort3/work/snort3-3.=
0.0-255/src/time/tsc_clock.cc:24:<o:p></o:p></p>
<p class=3D"MsoPlainText">/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=3D"MsoPlainText">error: invalid output constraint '=3Da' in asm<o:=
p></o:p></p>
<p class=3D"MsoPlainText">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; asm vo=
latile(&quot;rdtsc&quot; : &quot;=3Da&quot; (lo), &quot;=3Dd&quot; (hi));<o=
:p></o:p></p>
<p class=3D"MsoPlainText">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ^<o:p></o:p></p>
<p class=3D"MsoPlainText">1 error generated.<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">This error occurs on a stock FreeBSD 12.0 installati=
on and is not specific to pfSense.&nbsp; Could someone from the Snort3 team=
 please take a look?<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">Thanks,<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal"><b><i><span style=3D"font-size:12.0pt;color:#1F497D"=
>Bill Meeks<o:p></o:p></span></i></b></p>
<p class=3D"MsoNormal"><b><i><span style=3D"font-size:10.0pt;color:#1F497D"=
>Vidalia, GA USA</span></i></b><o:p></o:p></p>
</div>
</blockquote>
<p><br>
</p>
<p>Try the attached patch.&nbsp; Make sure you're building without --enable=
-tsc-clock.</p>
</body>
</html>

--_000_b4684f4775a63974d167c02c8d8ec760ciscocom_--

--_004_b4684f4775a63974d167c02c8d8ec760ciscocom_
Content-Type: text/x-patch; name="tscclock.diff"
Content-Description: tscclock.diff
Content-Disposition: attachment; filename="tscclock.diff"; size=1714;
	creation-date="Tue, 23 Jul 2019 04:30:12 GMT";
	modification-date="Tue, 23 Jul 2019 04:30:12 GMT"
Content-ID: <[email protected]>
Content-Transfer-Encoding: base64

ZGlmZiAtLWdpdCBhL3NyYy90aW1lL0NNYWtlTGlzdHMudHh0IGIvc3JjL3RpbWUvQ01ha2VMaXN0
cy50eHQNCmluZGV4IDkxZWE1MzQ1Yi4uYWI5Mzc1NWM5IDEwMDY0NA0KLS0tIGEvc3JjL3RpbWUv
Q01ha2VMaXN0cy50eHQNCisrKyBiL3NyYy90aW1lL0NNYWtlTGlzdHMudHh0DQpAQCAtMSwyMiAr
MSwyNSBAQA0KK3NldCAoIFRJTUVfSU5DTFVERVMNCisgICAgY2xvY2tfZGVmcy5oDQorICAgIHBh
Y2tldF90aW1lLmg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QogICAgIHN0YXRpYyB1aW50NjRfdCBjb3VudGVyKCkNCiAg
ICAgew0KLSNpZiBkZWZpbmVkKF9fYWFyY2g2NF9fKQ0KKyNpZiBkZWZpbmVkKF9faTM4Nl9fKSB8
fCBkZWZpbmVkKF9feDg2XzY0X18pDQorICAgICAgICB1aW50MzJfdCBsbywgaGk7DQorICAgICAg
ICBhc20gdm9sYXRpbGUoInJkdHNjIiA6ICI9YSIgKGxvKSwgIj1kIiAoaGkpKTsNCisgICAgICAg
IHJldHVybiAoKHVpbnQ2NF90KWhpIDw8IDMyKSB8IGxvOw0KKyNlbGlmIGRlZmluZWQoX19hYXJj
aDY0X18pDQogICAgICAgICB1aW50NjRfdCB0aWNrczsNCi0NCiAgICAgICAgIGFzbSB2b2xhdGls
ZSgibXJzICUwLCBDTlRWQ1RfRUwwIiA6ICI9ciIgKHRpY2tzKSk7DQogICAgICAgICByZXR1cm4g
dGlja3M7DQogI2Vsc2UNCi0gICAgICAgIC8vIERlZmF1bHQgdG8geDg2LCBvdGhlciBhcmNocyB3
aWxsIGNvbXBpbGUgZXJyb3IgYW55d2F5DQotICAgICAgICB1aW50MzJfdCBsbywgaGk7DQotICAg
ICAgICBhc20gdm9sYXRpbGUoInJkdHNjIiA6ICI9YSIgKGxvKSwgIj1kIiAoaGkpKTsNCi0gICAg
ICAgIHJldHVybiAoKHVpbnQ2NF90KWhpIDw8IDMyKSB8IGxvOw0KKyNlcnJvciAiVHNjQ2xvY2sg
aXMgbm90IHN1cHBvcnRlZCBvbiB0aGlzIGFyY2hpdGVjdHVyZSEiDQogI2VuZGlmDQogICAgIH0N
CiANCg==

--_004_b4684f4775a63974d167c02c8d8ec760ciscocom_
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!

--_004_b4684f4775a63974d167c02c8d8ec760ciscocom_--