#36828: wine-devel: Undefined symbols "_wine_build", referenced from: _wine_get_build_id in config.o --------------------------+-------------------------- Reporter: asipper10@… | Owner: ryandesign@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: wine-devel | --------------------------+-------------------------- Comment (by ryandesign@…): Thanks. So this is interesting. Here's what my log has happening at the beginning of the destroot: {{{ :info:destroot make[1]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports .org_release_tarballs_ports_x11_wine-devel/wine- devel/work/wine-1.5.16/libs/wine' :info:destroot version=`(GIT_DIR=../../.git git describe HEAD 2>/dev/null || echo "wine-1.5.16") | sed -n -e '$s/\(.*\)/const char wine_build[] = "\1";/p'` && (echo $version | cmp -s - version.c) || echo $version
version.c || (rm -f version.c && exit 1) :info:destroot make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports .org_release_tarballs_ports_x11_wine-devel/wine- devel/work/wine-1.5.16/libs/wine' }}}
And then it continues on. Here's what yours says: {{{ :info:destroot make[1]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports .org_release_tarballs_ports_x11_wine-devel/wine- devel/work/wine-1.5.16/libs/wine' :info:destroot version=`(GIT_DIR=../../.git git describe HEAD 2>/dev/null || echo "wine-1.5.16") | sed -n -e '$s/\(.*\)/const char wine_build[] = "\1";/p'` && (echo $version | cmp -s - version.c) || echo $version
version.c || (rm -f version.c && exit 1) :info:destroot /opt/local/bin/gcc-apple-4.2 -m32 -c -I. -I. -I../../include -I../../include -D__WINESRC__ -DWINE_UNICODE_API="" -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -Wdeclaration-after- statement -Wempty-body -Wstrict-prototypes -Wwrite-strings -fno-omit- frame-pointer -Wpointer-arith -I/opt/local/include/freetype2 -I/opt/local/include -I/opt/local/include -pipe -O2 -arch i386 -o version.o version.c :info:destroot /opt/local/bin/gcc-apple-4.2 -m32 -dynamiclib -install_name /opt/local/lib/libwine.1.dylib -compatibility_version 1 -current_version 1.0 -Wl,-headerpad_max_install_names c_037.o c_10000.o c_10006.o c_10007.o c_10029.o c_1006.o c_10079.o c_10081.o c_1026.o c_1250.o c_1251.o c_1252.o c_1253.o c_1254.o c_1255.o c_1256.o c_1257.o c_1258.o c_1361.o c_20127.o c_20866.o c_20932.o c_21866.o c_28591.o c_28592.o c_28593.o c_28594.o c_28595.o c_28596.o c_28597.o c_28598.o c_28599.o c_28600.o c_28603.o c_28604.o c_28605.o c_28606.o c_424.o c_437.o c_500.o c_737.o c_775.o c_850.o c_852.o c_855.o c_856.o c_857.o c_860.o c_861.o c_862.o c_863.o c_864.o c_865.o c_866.o c_869.o c_874.o c_875.o c_878.o c_932.o c_936.o c_949.o c_950.o casemap.o collation.o compose.o config.o cptable.o debug.o fold.o ldt.o loader.o mbtowc.o mmap.o port.o sortkey.o string.o utf8.o wctomb.o wctype.o version.o ../../libs/port/libwine_port.a -framework CoreFoundation -L/opt/local/lib -framework CoreServices -lz -Wl,-no_pie -arch i386 -o libwine.1.0.dylib :info:destroot Undefined symbols for architecture i386: :info:destroot "_wine_build", referenced from: :info:destroot _wine_get_build_id in config.o :info:destroot ld: symbol(s) not found for architecture i386 :info:destroot collect2: ld returned 1 exit status :info:destroot make[1]: *** [libwine.1.0.dylib] Error 1 :info:destroot make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports .org_release_tarballs_ports_x11_wine-devel/wine- devel/work/wine-1.5.16/libs/wine' }}}
At which point it has failed. The line starting with `version=` is complicated and deserves some analysis. First, it tries to use `git` to determine the version of code being built. If that fails (for example if the code being built is not from git but from a release tarball, which is the case in MacPorts) then the string "wine-1.5.16" is used. (This string is presumably inserted into the code at the time the release tarball is produced.) The string from the preceding step is then wrapped in a line of C code, which assigns it to the C constant "wine_build". This line of C code is assigned to the shell variable "version". This shell variable is compared with the contents of the file "version.c". If they are not identical, the shell variable is written into the file. If writing the file fails, the file is deleted and the script exits with an error. In `make`, a file is automatically rebuilt if any of its dependencies have changed since it was built. version.c is used to build version.o, and version.o is a dependency of libwine. In my log, after running the command that begins with `version=`, nothing else happens. version.o and libwine are not rebuilt. This is what we would expect, since version.o and libwine have already been built in the build phase, and the version of code has not changed since then. But in your log, version.o is rebuilt, and then it tries to rebuild libwine and fails, saying wine_build is not defined. This tells us that the command that begins with `version=` did in fact change version.c in your case, thus triggering version.o to rebuild. It also shows that version.c did not get generated correctly this second time. Could you attach the file /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports .org_release_tarballs_ports_x11_wine-devel/wine- devel/work/wine-1.5.16/libs/wine/version.c so that we can see what ended up inside it? Also, could you run the following command and tell us what output, if any, it produces: {{{ echo `(GIT_DIR=../../.git git describe HEAD 2>/dev/null || echo "wine-1.5.16") | sed -n -e '$s/\(.*\)/const char wine_build[] = "\1";/p'` }}} -- Ticket URL: <https://trac.macports.org/ticket/36828#comment:6> MacPorts <http://www.macports.org/> Ports system for Mac OS