public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
* What is the lowest version of glibc I can use to build gcc 4.8.3 and libstdc++?
@ 2023-10-05  2:52 조안나
  2023-10-05  6:53 ` Jonathan Wakely
  0 siblings, 1 reply; 3+ messages in thread
From: 조안나 @ 2023-10-05  2:52 UTC (permalink / raw)
  To: libstdc++

[-- Attachment #1: Type: text/plain, Size: 1011 bytes --]

Situation:
I am attempting to migrate legacy C programs to C++11
For use in older distributions, I static link libstdc++ through the
-static-libstdc++ option
C++11 is supported after version 4.8.3 of gcc, So I built it on CentOS7
where gcc 4.8.5 installed.

Result showed a dependence on glibc and was only available in distributions
with glibc14 and later versions installed.
The required version felt a little high because many customers use old
distribution.
I came up with the idea of building libstdc++ myself using a lower version
of glibc to reduce dependency.

First I tried using glibc 2.5 for gcc 4.8.3
Same, I built it on CentOS7 where gcc 4.8.5 and glibc 2.17 installed.
But failed with the error below:
configure: error: unsupported system, cannot find sizeof (omp_lock_t)

I think I lowered the glibc too much, but I couldn't find a document about
compatibility between gcc or libstdc++ and glibc.
What is the lowest version of glibc I can use to build gcc 4.8.3 and
libstdc++?
Can somebody help?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: What is the lowest version of glibc I can use to build gcc 4.8.3 and libstdc++?
  2023-10-05  2:52 What is the lowest version of glibc I can use to build gcc 4.8.3 and libstdc++? 조안나
@ 2023-10-05  6:53 ` Jonathan Wakely
  2023-10-05  8:32   ` Jonathan Wakely
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Wakely @ 2023-10-05  6:53 UTC (permalink / raw)
  To: 조안나; +Cc: libstdc++

[-- Attachment #1: Type: text/plain, Size: 1692 bytes --]

On Thu, 5 Oct 2023, 03:53 조안나, <opehn0@gmail.com> wrote:

> Situation:
> I am attempting to migrate legacy C programs to C++11
> For use in older distributions, I static link libstdc++ through the
> -static-libstdc++ option
> C++11 is supported after version 4.8.3 of gcc, So I built it on CentOS7
> where gcc 4.8.5 installed.
>
> Result showed a dependence on glibc and was only available in
> distributions with glibc14 and later versions installed.
>

glibc14?

The required version felt a little high because many customers use old
> distribution.
> I came up with the idea of building libstdc++ myself using a lower version
> of glibc to reduce dependency.
>

Why not just build gcc on the oldest distribution you need to support? You
can use a VM or container to create the build environment.


> First I tried using glibc 2.5 for gcc 4.8.3
> Same, I built it on CentOS7 where gcc 4.8.5 and glibc 2.17 installed.
> But failed with the error below:
> configure: error: unsupported system, cannot find sizeof (omp_lock_t)
>

That isn't used by libstdc++, that's libgomp. If you don't need OpenMP you
can use --disable-libgomp


> I think I lowered the glibc too much, but I couldn't find a document about
> compatibility between gcc or libstdc++ and glibc.
>

https://gcc.gnu.org/onlinedocs/gcc-13.2.0/libstdc++/manual/manual/setup.html#manual.intro.setup.prereq
documents it. But that's a minimum. Libstdc++ will use newer glibc features
such as __cxa_atexit when available, and will be less standards-conforming
without it.


What is the lowest version of glibc I can use to build gcc 4.8.3 and
> libstdc++?
> Can somebody help?
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: What is the lowest version of glibc I can use to build gcc 4.8.3 and libstdc++?
  2023-10-05  6:53 ` Jonathan Wakely
@ 2023-10-05  8:32   ` Jonathan Wakely
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Wakely @ 2023-10-05  8:32 UTC (permalink / raw)
  To: 조안나; +Cc: libstdc++

On Thu, 5 Oct 2023 at 07:53, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
>
>
>
> On Thu, 5 Oct 2023, 03:53 조안나, <opehn0@gmail.com> wrote:
>>
>> Situation:
>> I am attempting to migrate legacy C programs to C++11
>> For use in older distributions, I static link libstdc++ through the -static-libstdc++ option
>> C++11 is supported after version 4.8.3 of gcc, So I built it on CentOS7 where gcc 4.8.5 installed.
>>
>> Result showed a dependence on glibc and was only available in distributions with glibc14 and later versions installed.
>
>
> glibc14?
>
>> The required version felt a little high because many customers use old distribution.
>> I came up with the idea of building libstdc++ myself using a lower version of glibc to reduce dependency.
>
>
> Why not just build gcc on the oldest distribution you need to support? You can use a VM or container to create the build environment.
>
>>
>> First I tried using glibc 2.5 for gcc 4.8.3
>> Same, I built it on CentOS7 where gcc 4.8.5 and glibc 2.17 installed.
>> But failed with the error below:
>> configure: error: unsupported system, cannot find sizeof (omp_lock_t)
>
>
> That isn't used by libstdc++, that's libgomp. If you don't need OpenMP you can use --disable-libgomp
>
>>
>> I think I lowered the glibc too much, but I couldn't find a document about compatibility between gcc or libstdc++ and glibc.
>
>
> https://gcc.gnu.org/onlinedocs/gcc-13.2.0/libstdc++/manual/manual/setup.html#manual.intro.setup.prereq documents it. But that's a minimum. Libstdc++ will use newer glibc features such as __cxa_atexit when available, and will be less standards-conforming without it.

Another example is that std::chrono::system_clock will be unavailable
with older glibc versions, unless you configure with
--enable-libstdcxx-time=rt which creates a dependency on librt. Glibc
2.17 moved the clock_gettime and sched_yield (used by
std::this_thread::yield) functions to libc instead of librt, so that
libstdc++ doesn't need librt to provide complete C++11 clock and
thread features.

>
>
>> What is the lowest version of glibc I can use to build gcc 4.8.3 and libstdc++?
>> Can somebody help?

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-10-05  8:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-05  2:52 What is the lowest version of glibc I can use to build gcc 4.8.3 and libstdc++? 조안나
2023-10-05  6:53 ` Jonathan Wakely
2023-10-05  8:32   ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).