* [Buildroot] [PATCH] docs/manual: gcc 4.4 is the lowest we are known to work with
@ 2018-08-05 11:46 Yann E. MORIN
2018-08-09 13:08 ` Matthew Weber
0 siblings, 1 reply; 6+ messages in thread
From: Yann E. MORIN @ 2018-08-05 11:46 UTC (permalink / raw)
To: buildroot
gcc-2.95 is old. No, it is not old; it is antediluvian.
The odlest gcc version we are testing against is gcc-4.4 (on Holiss'
autobuilder using RHEL6.5).
Update the manual accordingly.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Hollis Blanchard <hollis_blanchard@mentor.com>
---
docs/manual/prerequisite.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/manual/prerequisite.txt b/docs/manual/prerequisite.txt
index 110fab41fd..66e1b88f16 100644
--- a/docs/manual/prerequisite.txt
+++ b/docs/manual/prerequisite.txt
@@ -23,8 +23,8 @@ between distributions).
** +make+ (version 3.81 or any later)
** +binutils+
** +build-essential+ (only for Debian based systems)
-** +gcc+ (version 2.95 or any later)
-** `g++` (version 2.95 or any later)
+** +gcc+ (version 4.4 or any later)
+** `g++` (version 4.4 or any later)
** +bash+
** +patch+
** +gzip+
--
2.14.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] docs/manual: gcc 4.4 is the lowest we are known to work with
2018-08-05 11:46 [Buildroot] [PATCH] docs/manual: gcc 4.4 is the lowest we are known to work with Yann E. MORIN
@ 2018-08-09 13:08 ` Matthew Weber
2018-08-09 13:14 ` Baruch Siach
2018-08-09 17:14 ` Hollis Blanchard
0 siblings, 2 replies; 6+ messages in thread
From: Matthew Weber @ 2018-08-09 13:08 UTC (permalink / raw)
To: buildroot
All,
On Sun, Aug 5, 2018 at 6:46 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
> gcc-2.95 is old. No, it is not old; it is antediluvian.
>
> The odlest gcc version we are testing against is gcc-4.4 (on Holiss'
> autobuilder using RHEL6.5).
>
Any suggestions if we keep the minimum host compiler requirement at
4.4, how should I address the below build failures with "error:
'__ATOMIC_ACQUIRE' undeclared " on the RHEL6.5 autobuilder?
http://autobuild.buildroot.net/?reason=host-libselinux-2.7
If this was a more recent compiler version issue, I'd dig into the
package and look at up-streaming a compatibility ifdef check.
Matt
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] docs/manual: gcc 4.4 is the lowest we are known to work with
2018-08-09 13:08 ` Matthew Weber
@ 2018-08-09 13:14 ` Baruch Siach
2018-08-09 13:41 ` Matthew Weber
2018-08-09 17:14 ` Hollis Blanchard
1 sibling, 1 reply; 6+ messages in thread
From: Baruch Siach @ 2018-08-09 13:14 UTC (permalink / raw)
To: buildroot
Hi Matt,
Matthew Weber writes:
> On Sun, Aug 5, 2018 at 6:46 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>>
>> gcc-2.95 is old. No, it is not old; it is antediluvian.
>>
>> The odlest gcc version we are testing against is gcc-4.4 (on Holiss'
>> autobuilder using RHEL6.5).
>>
>
> Any suggestions if we keep the minimum host compiler requirement at
> 4.4, how should I address the below build failures with "error:
> '__ATOMIC_ACQUIRE' undeclared " on the RHEL6.5 autobuilder?
> http://autobuild.buildroot.net/?reason=host-libselinux-2.7
>
> If this was a more recent compiler version issue, I'd dig into the
> package and look at up-streaming a compatibility ifdef check.
The atomic operations were introduced in gcc version 4.7:
https://gcc.gnu.org/gcc-4.7/changes.html
baruch
--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] docs/manual: gcc 4.4 is the lowest we are known to work with
2018-08-09 13:14 ` Baruch Siach
@ 2018-08-09 13:41 ` Matthew Weber
0 siblings, 0 replies; 6+ messages in thread
From: Matthew Weber @ 2018-08-09 13:41 UTC (permalink / raw)
To: buildroot
Baruch,
On Thu, Aug 9, 2018 at 8:15 AM Baruch Siach <baruch@tkos.co.il> wrote:
>
> Hi Matt,
>
> Matthew Weber writes:
> > On Sun, Aug 5, 2018 at 6:46 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> >>
> >> gcc-2.95 is old. No, it is not old; it is antediluvian.
> >>
> >> The odlest gcc version we are testing against is gcc-4.4 (on Holiss'
> >> autobuilder using RHEL6.5).
> >>
> >
> > Any suggestions if we keep the minimum host compiler requirement at
> > 4.4, how should I address the below build failures with "error:
> > '__ATOMIC_ACQUIRE' undeclared " on the RHEL6.5 autobuilder?
> > http://autobuild.buildroot.net/?reason=host-libselinux-2.7
> >
> > If this was a more recent compiler version issue, I'd dig into the
> > package and look at up-streaming a compatibility ifdef check.
>
> The atomic operations were introduced in gcc version 4.7:
>
> https://gcc.gnu.org/gcc-4.7/changes.html
>
Yeah.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] docs/manual: gcc 4.4 is the lowest we are known to work with
2018-08-09 13:08 ` Matthew Weber
2018-08-09 13:14 ` Baruch Siach
@ 2018-08-09 17:14 ` Hollis Blanchard
2018-08-13 14:35 ` Matthew Weber
1 sibling, 1 reply; 6+ messages in thread
From: Hollis Blanchard @ 2018-08-09 17:14 UTC (permalink / raw)
To: buildroot
On 08/09/2018 06:08 AM, Matthew Weber wrote:
>
> Any suggestions if we keep the minimum host compiler requirement at
> 4.4, how should I address the below build failures with "error:
> '__ATOMIC_ACQUIRE' undeclared " on the RHEL6.5 autobuilder?
> http://autobuild.buildroot.net/?reason=host-libselinux-2.7
>
> If this was a more recent compiler version issue, I'd dig into the
> package and look at up-streaming a compatibility ifdef check.
I'm not an expert in this area, but I'm surprised atomic operations are
needed in addition to the pthread_mutex_lock. See these comments, for
example:
https://stackoverflow.com/questions/24137964/does-pthread-mutex-lock-contains-memory-fence-instruction
. AFAIK, these atomic operations could be replaced with their native
equivalents.
That said, I'm not using SELinux, and even if I were I wouldn't care too
much about the host binaries, so I'm not interested in a lengthy email
debate about compiler optimizations, processor pipelines, atomic
operations, and memory barriers. :-) If we're not comfortable with
removing them altogether, then I think we could use the older "__sync"
builtins
<https://gcc.gnu.org/onlinedocs/gcc-4.4.7/gcc/Atomic-Builtins.html>
instead. Going for correctness instead of performance:
--- output/build/host-libselinux-2.7/src/label_file.h.orig 2018-08-09 09:47:46.432960085 -0700
+++ output/build/host-libselinux-2.7/src/label_file.h 2018-08-09 09:50:47.036960057 -0700
@@ -349,8 +349,14 @@
* init_routine does not take a parameter, it's not possible
* to use, so we generate the same effect with atomics and a
* mutex */
+#ifdef __ATOMIC_ACQUIRE
regex_compiled =
__atomic_load_n(&spec->regex_compiled, __ATOMIC_ACQUIRE);
+#else
+ /* GCC <4.7 */
+ __sync_synchronize();
+ regex_compiled = spec->regex_compiled;
+#endif
if (regex_compiled) {
return 0; /* already done */
}
@@ -358,8 +364,14 @@
__pthread_mutex_lock(&spec->regex_lock);
/* Check if another thread compiled the regex while we waited
* on the mutex */
+#ifdef __ATOMIC_ACQUIRE
regex_compiled =
__atomic_load_n(&spec->regex_compiled, __ATOMIC_ACQUIRE);
+#else
+ /* GCC <4.7 */
+ __sync_synchronize();
+ regex_compiled = spec->regex_compiled;
+#endif
if (regex_compiled) {
__pthread_mutex_unlock(&spec->regex_lock);
return 0;
@@ -402,7 +414,13 @@
}
/* Done. */
+#ifdef __ATOMIC_RELEASE
__atomic_store_n(&spec->regex_compiled, true, __ATOMIC_RELEASE);
+#else
+ /* GCC <4.7 */
+ spec->regex_compiled = true;
+ __sync_synchronize();
+#endif
__pthread_mutex_unlock(&spec->regex_lock);
return 0;
}
If there's general agreement with this approach, I can submit it as a
Buildroot patch.
Hollis Blanchard
Mentor Graphics Emulation Division
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180809/f849b621/attachment.html>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] docs/manual: gcc 4.4 is the lowest we are known to work with
2018-08-09 17:14 ` Hollis Blanchard
@ 2018-08-13 14:35 ` Matthew Weber
0 siblings, 0 replies; 6+ messages in thread
From: Matthew Weber @ 2018-08-13 14:35 UTC (permalink / raw)
To: buildroot
All,
On Thu, Aug 9, 2018 at 12:14 PM Hollis Blanchard
<hollis_blanchard@mentor.com> wrote:
>
> On 08/09/2018 06:08 AM, Matthew Weber wrote:
>
>
> Any suggestions if we keep the minimum host compiler requirement at
> 4.4, how should I address the below build failures with "error:
> '__ATOMIC_ACQUIRE' undeclared " on the RHEL6.5 autobuilder?
> http://autobuild.buildroot.net/?reason=host-libselinux-2.7
>
I've submitted this patch to require at least 4.7. I don't have a
target to test this. Hollis, would you mind trying it on your RHEL
6.5?
http://patchwork.ozlabs.org/patch/957001/
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-08-13 14:35 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-05 11:46 [Buildroot] [PATCH] docs/manual: gcc 4.4 is the lowest we are known to work with Yann E. MORIN
2018-08-09 13:08 ` Matthew Weber
2018-08-09 13:14 ` Baruch Siach
2018-08-09 13:41 ` Matthew Weber
2018-08-09 17:14 ` Hollis Blanchard
2018-08-13 14:35 ` Matthew Weber
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.