Opened 13 months ago

Last modified 4 months ago

#68645 new defect

gdal @3.7.3 Fails to Build using clang-17 on Lion: error: cannot initialize a parameter of type 'char *' with an rvalue of type 'char **'

Reported by: RobK88 Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: lion mountainlion Cc: Veence (Vincent), nilason (Nicklas Larsson), RobK88, Dave-Allured (Dave Allured), cooljeanius (Eric Gallager)
Port: gdal

Description (last modified by RobK88)

I am unable to upgrade gdal on Lion.

bash-3.2$ sudo port clean gdal
--->  Cleaning gdal
bash-3.2$ 
bash-3.2$ sudo port -v upgrade gdal 
--->  Computing dependencies for gdal.
--->  Fetching archive for gdal

etc etc

[  9%] Building C object frmts/gtiff/libtiff/CMakeFiles/libtiff.dir/tif_jpeg_12.c.o
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_gdal/gdal/work/build/frmts/gtiff/libtiff && /opt/local/bin/clang-mp-17 -DDONT_DEPRECATE_SPRINTF -DGDAL_COMPILATION -DHOST_FILLORDER=FILLORDER_LSB2MSB -DJPEG_DUAL_MODE_8_12 -DJPEG_SUPPORT -DLERC_SUPPORT -DLIBDEFLATE_SUPPORT -DOJPEG_SUPPORT -DPIXARLOG_SUPPORT -DRENAME_INTERNAL_LIBTIFF_SYMBOLS -DWEBP_SUPPORT -DZIP_SUPPORT -DZSTD_SUPPORT -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_gdal/gdal/work/gdal-3.7.3/port -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_gdal/gdal/work/build/port -I/opt/local/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_gdal/gdal/work/build/frmts/jpeg/libjpeg12 -pipe -Os -I/opt/local/include/LegacySupport -DNDEBUG -I/opt/local/include -I/opt/local/include/LegacySupport -fvisibility=hidden -arch x86_64 -mmacosx-version-min=10.7 -fPIC -Wall -Wextra -Winit-self -Wunused-parameter -Wmissing-prototypes -Wmissing-declarations -Wshorten-64-to-32 -Wshadow -Wmissing-include-dirs -Wformat -Werror=format-security -Wno-format-nonliteral -Werror=vla -Wdate-time -Wnull-dereference -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -std=gnu99 -MD -MT frmts/gtiff/libtiff/CMakeFiles/libtiff.dir/tif_jpeg_12.c.o -MF CMakeFiles/libtiff.dir/tif_jpeg_12.c.o.d -o CMakeFiles/libtiff.dir/tif_jpeg_12.c.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_gdal/gdal/work/gdal-3.7.3/frmts/gtiff/libtiff/tif_jpeg_12.c
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_gdal/gdal/work/build'
[  9%] Built target libtiff
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_gdal/gdal/work/build'
make: *** [all] Error 2
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_gdal/gdal/work/build'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_gdal/gdal/work/build" && /usr/bin/make -j4 -w VERBOSE=ON 
Exit code: 2
Error: Failed to build gdal: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_gdal/gdal/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.

The workaround is to build using clang-16. It looks like gdal is yet another port that will not compile using clang-17 on Lion.

sudo port upgrade gdal configure.compiler=macports-clang-16
--->  Computing dependencies for gdal.
--->  Fetching archive for gdal
etc
etc
--->  Cleaning gdal
--->  Removing work directory for gdal
--->  Scanning binaries for linking errors
--->  No broken files found.                             
--->  No broken ports found.

bash-3.2$ port installed gdal
The following ports are currently installed:
  gdal @3.7.2_1+postgresql15+proj9
  gdal @3.7.3_0+postgresql15+proj9 (active)
bash-3.2$

Attachments (1)

main.log (269.6 KB) - added by RobK88 13 months ago.

Download all attachments as: .zip

Change History (15)

Changed 13 months ago by RobK88

Attachment: main.log added

comment:1 Changed 13 months ago by RobK88

Cc: RobK88 added

comment:2 Changed 13 months ago by RobK88

Port: gdal added; gdak removed

comment:3 Changed 13 months ago by RobK88

Summary: gdal @3.7.3 Fails to Build on Liongdal @3.7.3 Fails to Build using clang-17 on Lion

comment:4 Changed 13 months ago by nilason (Nicklas Larsson)

The same problem does occur with 10.8, Mountain Lion, too.

comment:5 Changed 13 months ago by RobK88

Description: modified (diff)

comment:6 Changed 13 months ago by RobK88

Keywords: mountainlion added

comment:7 Changed 13 months ago by kencu (Ken)

the error here is not the "verbose_abort" issue we've seen in a few other ports, but something different:

969	:info:build In file included from /opt/local/libexec/llvm-17/bin/../include/c++/v1/__format/formatter_integral.h:32:
970	:info:build /opt/local/libexec/llvm-17/bin/../include/c++/v1/locale:3360:35: error: cannot initialize a parameter of type 'char *' with an rvalue of type 'char **'
971	:info:build  3360 |         __n = __libcpp_asprintf_l(&__bb, _LIBCPP_GET_C_LOCALE, "%.0Lf", __units);
972	:info:build       |                                   ^~~~~
973	:info:build /opt/local/libexec/llvm-17/bin/../include/c++/v1/__locale_dir/locale_base_api/bsd_locale_defaults.h:33:72: note: expanded from macro '__libcpp_asprintf_l'
974	:info:build    33 | #define __libcpp_asprintf_l(...)                            asprintf_l(__VA_ARGS__)
975	:info:build       |                                                                        ^~~~~~~~~~~

at the moment I have no idea why this would be an error for clang-17 but not for clang-16, but presumably clang-17 is a bit more strict and doesn't like something about that construct.

comment:8 Changed 13 months ago by kencu (Ken)

Summary: gdal @3.7.3 Fails to Build using clang-17 on Liongdal @3.7.3 Fails to Build using clang-17 on Lion: error: cannot initialize a parameter of type 'char *' with an rvalue of type 'char **'

comment:9 Changed 13 months ago by nilason (Nicklas Larsson)

This has probably been solved by b0d1ec3 if I understand correctly.

At least bot builds for both Lion and Mountain Lion seem to pass now.

comment:10 Changed 12 months ago by RobK88

I thought gdal@3.8.0 would build from source on Lion since clang-16 has been added as a build dependency. But no it did not:

:info:build Undefined symbols for architecture x86_64:
:info:build   "std::__1::__shared_mutex_base::lock_shared()", referenced from:
:info:build       __ZNSt3__112shared_mutex11lock_sharedB7v160006Ev in cpl_vsi_mem.cpp.o
:info:build   "std::__1::__shared_mutex_base::unlock_shared()", referenced from:
:info:build       __ZNSt3__112shared_mutex13unlock_sharedB7v160006Ev in cpl_vsi_mem.cpp.o
:info:build   "std::__1::__shared_mutex_base::lock()", referenced from:
:info:build       __ZNSt3__112shared_mutex4lockB7v160006Ev in cpl_vsi_mem.cpp.o
:info:build   "std::__1::__shared_mutex_base::unlock()", referenced from:
:info:build       __ZNSt3__112shared_mutex6unlockB7v160006Ev in cpl_vsi_mem.cpp.o
:info:build   "std::__1::__shared_mutex_base::__shared_mutex_base()", referenced from:
:info:build       __ZNSt3__112shared_mutexC2B7v160006Ev in cpl_vsi_mem.cpp.o
:info:build ld: symbol(s) not found for architecture x86_64
:info:build clang: error: linker command failed with exit code 1 (use -v to see invocation)
:info:build make[2]: *** [libgdal.34.3.8.0.dylib] Error 1
:info:build make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_gdal/gdal/work/build'
:info:build make[1]: *** [CMakeFiles/GDAL.dir/all] Error 2
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_gdal/gdal/work/build'
:info:build make: *** [all] Error 2
:info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_gdal/gdal/work/build'
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_gdal/gdal/work/build" && /usr/bin/make -j4 -w VERBOSE=ON 
:info:build Exit code: 2
:error:build Failed to build gdal: command execution failed
:debug:build Error code: CHILDSTATUS 1478 2
:debug:build Backtrace: command execution failed
:debug:build     while executing
:debug:build "system {*}$notty {*}$callback {*}$nice $fullcmdstring"
:debug:build     invoked from within
:debug:build "command_exec -callback portprogress::target_progress_callback build"
:debug:build     (procedure "portbuild::build_main" line 8)
:debug:build     invoked from within
:debug:build "$procedure $targetname"
:error:build See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_gdal/gdal/main.log for details.

comment:11 in reply to:  10 Changed 12 months ago by nilason (Nicklas Larsson)

Replying to RobK88:

I thought gdal@3.8.0 would build from source on Lion since clang-16 has been added as a build dependency. But no it did not:

:info:build Undefined symbols for architecture x86_64:

...

}}}

That error is a new issue, reported at https://trac.macports.org/ticket/68716.

Version 0, edited 12 months ago by nilason (Nicklas Larsson) (next)

comment:12 Changed 5 months ago by Dave-Allured (Dave Allured)

@RobK88: I think this issue is fixed by https://trac.macports.org/ticket/68716. Therefore I am requesting this other ticket https://trac.macports.org/ticket/68645 should be closed. If it does not work for you on Lion, please re-open this ticket https://trac.macports.org/ticket/68645 and post details.

comment:13 Changed 5 months ago by Dave-Allured (Dave Allured)

Cc: Dave-Allured added

comment:14 Changed 4 months ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added
Note: See TracTickets for help on using tickets.