src: make Suricata build on Solaris
Make sure these boxes are signed before submitting your Pull Request -- thank you.
- [X] I have read the contributing guide lines at https://docs.suricata.io/en/latest/devguide/contributing/contribution-process.html
- [X] I have signed the Open Information Security Foundation contribution agreement at https://suricata.io/about/contribution-agreement/ (note: this is only required once)
- [X] I have updated the user guide (in doc/userguide/) to reflect the changes made (if applicable)
- [X] I have created a ticket at https://redmine.openinfosecfoundation.org/projects/suricata/issues (if applicable)
Link to ticket: https://redmine.openinfosecfoundation.org/issues/7005
Describe changes:
- src/main.c: Fix alignment problems on SPARC. Based on similar fixes found at: https://lists.debian.org/debian-sparc/2012/01/msg00012.html and: https://www.winehq.org/pipermail/wine-patches/2011-February/098547.html
- src/source-pcap-file-directory-helper.c, src/util-path.c: Solaris doesn't define d_type dirent member and DT_REG type.
- src/suricata.c: Only Linux and the BSDs support the RLIMIT_NPROC resource limit.
- src/util-syslog.c: Solaris syslog.h doesn't define LOG_FTP.
- src/util-time.c: Solaris tm doesn't define tm_gmtoff member.
What's the difference between
__sunand__sparc?
Hi Jeff,
__sun means SunOS, in other words Solaris OS.
__sparc means hardware platform with SPARC CPU inside.
That part relates just to SPARC. I have hit a memory miss-align. That is quite common and that ta 6 is the easiest solution/workaround. Once the CPU detects the address alignment issue, that instruction just causes CPU to emulate that particular instruction with multiple instructions. There is slight hardware penalty, but it works reliably.
Regards, m.
NOTE: This PR may contain new authors.
Codecov Report
Attention: Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.
Project coverage is 79.10%. Comparing base (
304271e) to head (453c734). Report is 243 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #11297 +/- ##
==========================================
- Coverage 82.61% 79.10% -3.52%
==========================================
Files 919 919
Lines 248997 248821 -176
==========================================
- Hits 205717 196826 -8891
- Misses 43280 51995 +8715
| Flag | Coverage Δ | |
|---|---|---|
| fuzzcorpus | 60.60% <0.00%> (-0.29%) |
:arrow_down: |
| livemode | 18.66% <42.85%> (+<0.01%) |
:arrow_up: |
| pcap | 44.16% <28.57%> (+0.02%) |
:arrow_up: |
| suricata-verify | ? |
|
| unittests | 59.01% <42.85%> (+<0.01%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
Run ./scripts/clang-format.sh check-branch --diffstat --show-commits >> check_formatting_log.txt 2>&1
src/threads.h | 4 +---
src/util-path.c | 2 +-
src/util-syslog.c | 32 ++++++++------------------------
3 files changed, 10 insertions(+), 28 deletions(-)
Commits on branch (new -> old):
23bbfe2d3 src: make Suricata build on Solaris
ERROR: Branch requires formatting
ERROR: View required changes with: clang-format.sh check-branch --diff
ERROR: Use ./scripts/clang-format.sh branch to fix formatting,
then add formatting changes to a new commit
Error: Formatting is not following code style guide!
Error: Process completed with exit code 1.
Do I understand correctly, that the commit message is wrong(ly formatted)? Could anyone guide me how to correct it?
Thank you, m.
Run ./scripts/clang-format.sh check-branch --diffstat --show-commits >> check_formatting_log.txt 2>&1 src/threads.h | 4 +--- src/util-path.c | 2 +- src/util-syslog.c | 32 ++++++++------------------------ 3 files changed, 10 insertions(+), 28 deletions(-) Commits on branch (new -> old): 23bbfe2d3 src: make Suricata build on Solaris ERROR: Branch requires formatting ERROR: View required changes with: clang-format.sh check-branch --diff ERROR: Use ./scripts/clang-format.sh branch to fix formatting, then add formatting changes to a new commit Error: Formatting is not following code style guide! Error: Process completed with exit code 1.Do I understand correctly, that the commit message is wrong(ly formatted)? Could anyone guide me how to correct it?
Thank you, m.
This should help: https://docs.suricata.io/en/latest/devguide/codebase/code-style.html
What's the difference between
__sunand__sparc?Hi Jeff,
__sunmeans SunOS, in other words Solaris OS.__sparcmeans hardware platform with SPARC CPU inside.That part relates just to SPARC. I have hit a memory miss-align. That is quite common and that
ta 6is the easiest solution/workaround. Once the CPU detects the address alignment issue, that instruction just causes CPU to emulate that particular instruction with multiple instructions. There is slight hardware penalty, but it works reliably.Regards, m.
Is there a use case when __sun is defined but __sparc isn't?
Is there a use case when
__sunis defined but__sparcisn't?
Yes, Solaris supports all kind of Intel architecture like __i386, __amd64 but also __x86_64: GCC architectures.
Sorry for an extra commit.
friendly ping @l1gi will you work further on this ?
friendly ping @l1gi will you work further on this ?
Yes, sorry for delay. Will try to prepare the new change today or tomorrow.
Thank you, m.
Thanks for the changes, we expect a new PR instead of pushing on the existing one cf https://docs.suricata.io/en/latest/devguide/contributing/code-submission-process.html#pull-requests
NOTE: This PR may contain new authors.
CI is red, please open a new rebased PR