Opened 7 weeks ago

Closed 32 hours ago

#70889 closed defect (fixed)

oath-toolkit @2.6.7: error: call to undeclared library function 'realloc' with type 'void *(void *, unsigned long)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

Reported by: laughingtiger Owned by: fracai
Priority: Normal Milestone:
Component: ports Version: 2.10.1
Keywords: arm64 sequoia Cc: laughingtiger
Port: oath-toolkit

Description

The OS is running on a M2 mac mini under UTM VM updated from Sequoia beta to 15.0 release. Ran latest Sequoia Macports installer and installed large number of ports without issue. xcode-select is latest version. Cleaned failed install of oath-toolkit and ran rm -rf /Library/Developer/CommandLineTools/usr/include/c++ Second attempted install also failed.

Attachments (5)

main.log (565.4 KB) - added by laughingtiger 7 weeks ago.
include_stdlib.diff (708 bytes) - added by calebstein1 (Caleb Stein) 7 weeks ago.
patch-2.6.11-include-stdlib.diff (478 bytes) - added by amolinas 7 weeks ago.
Portfile (2.4 KB) - added by amolinas 7 weeks ago.
Portfile.2 (2.3 KB) - added by yokuha 8 days ago.
Portfile for 2.6.12

Download all attachments as: .zip

Change History (17)

Changed 7 weeks ago by laughingtiger

Attachment: main.log added

comment:1 Changed 7 weeks ago by laughingtiger

Cc: laughingtiger added

comment:2 Changed 7 weeks ago by jmroot (Joshua Root)

Cc: arno+macports@… fracai removed
Keywords: arm64 sequoia added; arm-64 Sequoia removed
Owner: set to fracai
Status: newassigned
:info:build container.c:160:9: error: call to undeclared library function 'realloc' with type 'void *(void *, unsigned long)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
:info:build   160 |   tmp = realloc (container->keypackages,
:info:build       |         ^
:info:build container.c:160:9: note: include the header <stdlib.h> or explicitly provide a declaration for 'realloc'

Changed 7 weeks ago by calebstein1 (Caleb Stein)

Attachment: include_stdlib.diff added

comment:3 Changed 7 weeks ago by calebstein1 (Caleb Stein)

I was able to build on 15.0 using the patch I've attached. I'm not too familiar with the structure of upstream, so I'd rather someone with more familiarity there confirm whether adding these includes is actually safe or a good idea, but at least on my end this allows the build to succeed now.

comment:4 Changed 7 weeks ago by ryandesign (Ryan Carsten Schmidt)

Summary: oath-toolkit fails to build on Sequoia 15.0 on M2 Mac minioath-toolkit @2.6.7: error: call to undeclared library function 'realloc' with type 'void *(void *, unsigned long)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

In version 2.6.11, two of the three files you're patching already include stdlib.h. Let's start by trying to update the port to that version, adding the patch for the remaining file if it's needed.

comment:5 Changed 7 weeks ago by amolinas

Confirmed that it work with version 2.6.11 and applying the attached patch (patch-2.6.11-include-stdlib.diff). The difference with the previous submitted patch, apart from patching only global.c, is that stdlib.h is included after config.h (required). I also include my Portfile as a reference. It can contain obvious errors, as I just hacked it quickly.

Version 0, edited 7 weeks ago by amolinas (next)

Changed 7 weeks ago by amolinas

Changed 7 weeks ago by amolinas

Attachment: Portfile added

comment:6 Changed 6 weeks ago by ksbeattie (Keith Beattie)

I too can confirm that using the attached Portfile and patch-2.6.11-include-stdlib.diff files, this is now working.

Changed 8 days ago by yokuha

Attachment: Portfile.2 added

Portfile for 2.6.12

comment:7 Changed 8 days ago by yokuha

Installation worked for me for version 2.6.12 without the need for a patch, see the added updated Portfile.

In fact, I tried this as I could not find out where to store the patch file in the local file:// hierarchy of local Portfiles:-o

comment:8 Changed 5 days ago by fracai

I've tested the most recent Portfile from yokuha and it's working on Sonoma. I haven't yet upgraded to test on Sequoia, but I have the changes ready for a pull request if someone can verify it's good there.

comment:9 Changed 5 days ago by ryandesign (Ryan Carsten Schmidt)

The current port doesn't build on Sequoia so any update you submit can't make that worse so feel free to submit the PR without testing on Sequoia. CI may fail on macOS 15 since we don't have a buildbot worker set up for macOS 15 arm64 yet, but you can check whether it builds successfully on the macOS 15 x86_64 buildbot worker after the PR is merged.

comment:10 Changed 5 days ago by laughingtiger

I can confirm that the latest update installs and works on my M2 mac mini Sequoia 15.1 VM. Also ok on Sonoma M2 & intel mac mini's running 14.7.1. Thanks all

comment:12 Changed 32 hours ago by mohd-akram (Mohamed Akram)

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.