Bug 277896 - databases/mysql80-server databases/mysql81-server: fix build with libc++ 18 on i386
Summary: databases/mysql80-server databases/mysql81-server: fix build with libc++ 18 o...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Jochen Neumeister
URL:
Keywords:
Depends on:
Blocks: 276104
  Show dependency treegraph
 
Reported: 2024-03-22 20:49 UTC by Dimitry Andric
Modified: 2024-04-06 17:27 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (joneum)


Attachments
databases/mysql80-server databases/mysql81-server: fix build with libc++ 18 on i386 (1.88 KB, patch)
2024-03-22 20:51 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2024-03-22 20:49:34 UTC
When building against libc++ 18, several iostream classes now get
inlined into C++ binaries for efficiency. But because the mysql ports
use -malign-double on non-powerpc architectures, this causes an ABI
problem with libc++.so, which has not been built with that flag, at
least on i386. This can cause segfaults during the build of the port.

If it is not the architecture default, as it is on amd64, -malign-double
should not be used without recompiling basically the entire userspace
runtime. Quoting the gcc docs:

> Warning: if you use the -malign-double switch, structures containing
> the above types are aligned differently than the published application
> binary interface specifications for the x86-32 and are not binary
> compatible with structures in code compiled without that switch.

Hence, remove -malign-double from CXXFLAGS for these ports.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2024-03-22 20:51:01 UTC
Created attachment 249417 [details]
databases/mysql80-server databases/mysql81-server: fix build with libc++ 18 on i386
Comment 2 commit-hook freebsd_committer freebsd_triage 2024-04-06 17:26:21 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b49518c5c7c16418d7da0a5ce786da139b905bb1

commit b49518c5c7c16418d7da0a5ce786da139b905bb1
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-03-22 20:49:01 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-04-06 17:20:52 +0000

    databases/mysql80-server databases/mysql81-server: fix build with libc++ 18 on i386

    When building against libc++ 18, several iostream classes now get
    inlined into C++ binaries for efficiency. But because the mysql ports
    use -malign-double on non-powerpc architectures, this causes an ABI
    problem with libc++.so, which has not been built with that flag, at
    least on i386. This can cause segfaults during the build of the port.

    If it is not the architecture default, as it is on amd64, -malign-double
    should not be used without recompiling basically the entire userspace
    runtime. Quoting the gcc docs:

    > Warning: if you use the -malign-double switch, structures containing
    > the above types are aligned differently than the published application
    > binary interface specifications for the x86-32 and are not binary
    > compatible with structures in code compiled without that switch.

    Hence, remove -malign-double from CXXFLAGS for these ports.

    PR:             277896
    Approved by:    maintainer timeout (2 weeks)
    MFH:            2024Q1

 databases/mysql80-server/Makefile | 1 -
 databases/mysql81-server/Makefile | 1 -
 2 files changed, 2 deletions(-)
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-04-06 17:27:22 UTC
A commit in branch 2024Q1 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=154a19da2a20a6f899d7e1e92c1ddc56447a0b00

commit 154a19da2a20a6f899d7e1e92c1ddc56447a0b00
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-03-22 20:49:01 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-04-06 17:26:12 +0000

    databases/mysql80-server databases/mysql81-server: fix build with libc++ 18 on i386

    When building against libc++ 18, several iostream classes now get
    inlined into C++ binaries for efficiency. But because the mysql ports
    use -malign-double on non-powerpc architectures, this causes an ABI
    problem with libc++.so, which has not been built with that flag, at
    least on i386. This can cause segfaults during the build of the port.

    If it is not the architecture default, as it is on amd64, -malign-double
    should not be used without recompiling basically the entire userspace
    runtime. Quoting the gcc docs:

    > Warning: if you use the -malign-double switch, structures containing
    > the above types are aligned differently than the published application
    > binary interface specifications for the x86-32 and are not binary
    > compatible with structures in code compiled without that switch.

    Hence, remove -malign-double from CXXFLAGS for these ports.

    PR:             277896
    Approved by:    maintainer timeout (2 weeks)
    MFH:            2024Q1

    (cherry picked from commit b49518c5c7c16418d7da0a5ce786da139b905bb1)

 databases/mysql80-server/Makefile | 1 -
 databases/mysql81-server/Makefile | 1 -
 2 files changed, 2 deletions(-)