[MacPorts] #71743: mpdecimal can't build universal x86_64/i386. And because of this, python313 can't build universal x86_64/i386

MacPorts noreply at macports.org
Wed Jan 22 00:38:04 UTC 2025


#71743: mpdecimal can't build universal x86_64/i386. And because of this, python313
can't build universal x86_64/i386
-----------------------------------+-------------------------
  Reporter:  kencu                 |      Owner:  Schamschula
      Type:  defect                |     Status:  assigned
  Priority:  Normal                |  Milestone:
 Component:  ports                 |    Version:
Resolution:                        |   Keywords:
      Port:  mpdecimal, python313  |
-----------------------------------+-------------------------
Changes (by ryandesign):

 * cc: ryandesign (added)


Comment:

 The error in the normal universal log is:

 {{{
 ./mpdecimal.h:186:4: error: "unsupported platform: need mpd_size_t ==
 mpd_uint_t"
   #error "unsupported platform: need mpd_size_t == mpd_uint_t"
    ^
 }}}

 I agree that trying muniversal is a good idea.

 The muniversal builds fail with:

 {{{
 /opt/local/lib/libmpdec++.4.0.0.dylib differs […] and cannot be merged
 }}}

 This is unusual because dylibs should be mergable. This suggests that this
 file isn't actually a dylib, despite its name. What kind of file is it? Is
 it a text file? We've seen that once before in #71415. And, as we do
 there, we see this message in the log:

 {{{
 …/destroot-i386//opt/local/lib/libmpdec++.4.0.0.dylib and …/destroot-
 x86_64//opt/local/lib/libmpdec++.4.0.0.dylib have the same architectures
 (x86_64) and can't be in the same fat output file
 }}}

 And here I see that this is happening because the `-arch` flag is missing
 in the link line:

 {{{
 /usr/bin/clang++ -pthread -L../libmpdec -dynamiclib -fPIC -install_name
 /opt/local/lib/libmpdec++.4.dylib -compatibility_version 4.0
 -current_version 4.0.0 -Os -stdlib=libc++ -o libmpdec++.4.0.0.dylib
 .objs/decimal.o -lmpdec -lm
 }}}

 This is the case (and is wrong) even in a non-universal build.

 It looks like mpdecimal is unique in that it uses a variable LDXXFLAGS to
 link C++ code. MacPorts base and muniversal portgroups are not aware of
 this nonstandard variable and don't set it to any value. The portfile
 already sets it to include CXXFLAGS but this needs to be enhanced to also
 include LDFLAGS. It also needs to add whatever `-arch` flags are needed
 for the current type of build (universal or non-universal); alternately,
 `-arch` flags could be passed in the compiler variables.

 I'll see if I can fix this.

-- 
Ticket URL: <https://trac.macports.org/ticket/71743#comment:6>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list