[MacPorts] #36551: openmotif @2.3.3 -- Undefined symbols for architecture x86_64: "_main"
#36551: openmotif @2.3.3 -- Undefined symbols for architecture x86_64: "_main" ----------------------+-------------------------------- Reporter: ggpolo@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Keywords: linker | Port: openmotif ----------------------+-------------------------------- Hello, After some time without upgrading, I decided to do so yesterday and moved everything I could to +universal. Apparently, most of it went fine except for openmotif (which I need for geomview). I searched for related tickets and the best one I found was #24237, but all of the openmotif deps were built with +universal (except for xbitmaps). I get the following linker error when running "port install openmotif +universal": {{{ /usr/bin/clang -fno-strict-aliasing -arch x86_64 -arch i386 -Wall -g -fno- strict-aliasing -Wno-unused -Wno-comment -fno-tree-ter -I/opt/local/include -I/opt/local/include/freetype2 -arch x86_64 -arch i386 -o wmluiltok wmluiltok.o -L/opt/local/lib /opt/local/lib/libXp.dylib /opt/local/lib/libXext.dylib /opt/local/lib/libXft.dylib /opt/local/lib/libfontconfig.dylib /opt/local/lib/libiconv.dylib /opt/local/lib/libexpat.dylib /opt/local/lib/libfreetype.dylib -lbz2 /opt/local/lib/libXrender.dylib /opt/local/lib/libX11.dylib /opt/local/lib/libxcb.dylib /opt/local/lib/libXau.dylib /opt/local/lib/libXdmcp.dylib /opt/local/lib/libjpeg.dylib /opt/local/lib/libpng15.dylib -lz Undefined symbols for architecture x86_64: "_main", referenced from: -u command line option ld: symbol(s) not found for architecture x86_64 }}} Any ideas ? I got Xcode 4.5.1 and OS X 10.8.2. The same problem happens if I opt to perform openmotif -universal. Thanks for your time. -- Ticket URL: <https://trac.macports.org/ticket/36551> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36551: openmotif @2.3.3 -- Undefined symbols for architecture x86_64: "_main" ------------------------+-------------------------------- Reporter: ggpolo@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: openmotif | ------------------------+-------------------------------- Changes (by ryandesign@…): * keywords: linker => -- Ticket URL: <https://trac.macports.org/ticket/36551#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36551: openmotif @2.3.3 -- Undefined symbols for architecture x86_64: "_main" ------------------------+-------------------------------- Reporter: ggpolo@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: openmotif | ------------------------+-------------------------------- Comment (by ggpolo@…): I looked into this again and now I managed to solve the compilation problem. The problem is that the offending object file wmluiltok.o, which is generated from wmluiltok.c, may not have a main function after all (just like what the linker says). The file wmluiltok.c is generated by the flex program, which doesn't generate a main function except if the flex executable is actually a link to the lex binary (which generates the main function by default). I would think that nowadays most people moved to flex, but maybe it is not the case and openmotif prefers to assume lex is being used ? Anyway, the (or, better, one) solution is to prepend the file openmotif-2.3.3/tools/wml/wmluiltok.l with the directive %option main -- Ticket URL: <https://trac.macports.org/ticket/36551#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36551: openmotif @2.3.3 -- Undefined symbols for architecture x86_64: "_main" ------------------------+-------------------------------- Reporter: ggpolo@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: openmotif | ------------------------+-------------------------------- Comment (by ehesan@…): Could you please explain a bit how to "prepend the file openmotif-2.3.3/tools/wml/wmluiltok.l with the directive %option main" ? I am novice here .. and need to install opnemotif. I am facing exactly the same problem as it has been reported here for MacOS 10.8.2. Thanks a lot. Replying to [comment:2 ggpolo@…]:
I looked into this again and now I managed to solve the compilation problem. The problem is that the offending object file wmluiltok.o, which is generated from wmluiltok.c, may not have a main function after all (just like what the linker says). The file wmluiltok.c is generated by the flex program, which doesn't generate a main function except if the flex executable is actually a link to the lex binary (which generates the main function by default). I would think that nowadays most people moved to flex, but maybe it is not the case and openmotif prefers to assume lex is being used ?
Anyway, the (or, better, one) solution is to prepend the file openmotif-2.3.3/tools/wml/wmluiltok.l with the directive %option main
-- Ticket URL: <https://trac.macports.org/ticket/36551#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36551: openmotif @2.3.3 -- Undefined symbols for architecture x86_64: "_main" ------------------------+-------------------------------- Reporter: ggpolo@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: openmotif | ------------------------+-------------------------------- Comment (by ggpolo@…): Open wmluiltok.l for editing, insert the line %option main at top. The log file shows where the file lives. -- Ticket URL: <https://trac.macports.org/ticket/36551#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36551: openmotif @2.3.3 -- Undefined symbols for architecture x86_64: "_main" ------------------------+-------------------------------- Reporter: ggpolo@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: openmotif | ------------------------+-------------------------------- Comment (by jmr@…): Is this still a problem with 2.3.4? -- Ticket URL: <https://trac.macports.org/ticket/36551#comment:5> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36551: openmotif @2.3.3 -- Undefined symbols for architecture x86_64: "_main" ------------------------+-------------------------------- Reporter: ggpolo@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: openmotif | ------------------------+-------------------------------- Comment (by plm_macports@…): Replying to [comment:5 jmr@…]:
Is this still a problem with 2.3.4? yes
-- Ticket URL: <https://trac.macports.org/ticket/36551#comment:6> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36551: openmotif @2.3.3 -- Undefined symbols for architecture x86_64: "_main" ------------------------+-------------------------------- Reporter: ggpolo@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: openmotif | ------------------------+-------------------------------- Comment (by x.pechoultres@…): Still not building. I tried this patch to wmluiltok.l without success: {{{ %option main %{ /* * Motif * }}} -- Ticket URL: <https://trac.macports.org/ticket/36551#comment:9> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36551: openmotif @2.3.3 -- Undefined symbols for architecture x86_64: "_main" ------------------------+-------------------------------- Reporter: ggpolo@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: openmotif | ------------------------+-------------------------------- Changes (by ryandesign@…): * cc: eriwaldo.teixeira@…, ryandesign@… (added) Comment: Has duplicate #44854. The log says: {{{ :info:configure checking for flex... flex :info:configure checking lex output file root... lex.yy :info:configure checking lex library... none needed }}} This last line is the problem. In fact "none needed" appears to be erroneous; it [https://lists.gnu.org/archive/html/bug- autoconf/2011-05/msg00017.html should print] "none found"; whether or not it's needed is another matter, and in this case, it seems it is needed. On my system, when the flex port is installed, I get: {{{ :info:configure checking for flex... flex :info:configure checking lex output file root... lex.yy :info:configure checking lex library... -lfl }}} On my system, when the flex port is not installed, I get: {{{ :info:configure checking for flex... flex :info:configure checking lex output file root... lex.yy :info:configure checking lex library... -ll }}} So in my case there is always a lex library, but in both the log attached here and the one attached to #44854, there is not. So I would ask anyone experiencing this issue: * what does `which flex` say? * what does `flex -V` say? * is the flex port installed? * if not, does installing the flex port, then cleaning openmotif and trying again help or not? I think the preferred resolution would be adding a build dependency on the flex port, if that will solve the problem. -- Ticket URL: <https://trac.macports.org/ticket/36551#comment:10> MacPorts <http://www.macports.org/> Ports system for OS X
#36551: openmotif @2.3.3 -- Undefined symbols for architecture x86_64: "_main" ------------------------+-------------------------------- Reporter: ggpolo@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: openmotif | ------------------------+-------------------------------- Comment (by eriwaldo.teixeira@…): Installing port flex didnt solve it, I get the same error {{{ ---> Building openmotif Error: org.macports.build for port openmotif returned: command execution failed Please see the log file for port openmotif for details: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_x11_openmotif/openmotif/main.log To report a bug, follow the instructions in the guide: http://guide.macports.org/#project.tickets Error: Processing of port openmotif failed }}} the main.log still reports {{{ :info:configure checking for flex... flex :info:configure checking lex output file root... lex.yy :info:configure checking lex library... none needed }}} -- Ticket URL: <https://trac.macports.org/ticket/36551#comment:11> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts