[GRASS-dev] [GRASS GIS] #411: Makefile uses LD instead of GCC for linking leads to undefined symbol: __stack_chk_fail_local

#411: Makefile uses LD instead of GCC for linking leads to undefined symbol:
__stack_chk_fail_local
-----------------------------------------------------+----------------------
Reporter: RRosario | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: major | Milestone: 6.4.0
Component: default | Version: unspecified
Keywords: undefined symbol __stack_chk_fail_local | Platform: Unspecified
      Cpu: x86-32 |
-----------------------------------------------------+----------------------
The Makefile for Python SWIG uses LD for linking rather than GCC. On some
Linux systems, this causes Python to throw the error:

$ python -c "import _python_grass6"
Traceback (most recent call last):
   File "<string>", line 1, in <module>
ImportError: ./_python_grass6.so: undefined symbol: __stack_chk_fail_local

when the library python_grass6 is imported due to a stack smash guard.

I have confirmed that replacing LD with CC fixes this problem. On some
distributions of Linux, this can be fixed by adding "-fno-stack-protector"
to CFLAGS.

R.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/411&gt;
GRASS GIS <http://grass.osgeo.org>

#411: Makefile uses LD instead of GCC for linking leads to undefined symbol:
__stack_chk_fail_local
----------------------------------+-----------------------------------------
  Reporter: RRosario | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: SWIG (all bindings) | Version: svn-develbranch6
Resolution: | Keywords: undefined symbol __stack_chk_fail_local
  Platform: Linux | Cpu: x86-32
----------------------------------+-----------------------------------------
Changes (by RRosario):

  * platform: Unspecified => Linux
  * version: unspecified => svn-develbranch6
  * component: default => SWIG (all bindings)

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/411#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#411: Makefile uses LD instead of GCC for linking leads to undefined symbol:
__stack_chk_fail_local
----------------------------------+-----------------------------------------
  Reporter: RRosario | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: SWIG (all bindings) | Version: svn-develbranch6
Resolution: | Keywords: undefined symbol __stack_chk_fail_local
  Platform: Linux | Cpu: x86-32
----------------------------------+-----------------------------------------
Comment (by kyngchaos):

This isn't right on OSX either. We've spent some effort to get the
wxpython nviz and vdigit to compile correctly on different platforms, so
maybe that method should be used here also (patch attached).

There is still cleanup needed to completely conform to the GRASS make
system, but it should compile correctly now.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/411#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#411: Makefile uses LD instead of GCC for linking leads to undefined symbol:
__stack_chk_fail_local
----------------------------------+-----------------------------------------
  Reporter: RRosario | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: SWIG (all bindings) | Version: svn-develbranch6
Resolution: | Keywords: undefined symbol __stack_chk_fail_local
  Platform: Linux | Cpu: x86-32
----------------------------------+-----------------------------------------
Comment (by neteler):

What is the status of this report?

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/411#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#411: Makefile uses LD instead of GCC for linking leads to undefined symbol:
__stack_chk_fail_local
----------------------------------+-----------------------------------------
  Reporter: RRosario | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: SWIG (all bindings) | Version: svn-develbranch6
Resolution: | Keywords: undefined symbol __stack_chk_fail_local
  Platform: Linux | Cpu: x86-32
----------------------------------+-----------------------------------------
Comment (by glynn):

Replying to [comment:3 neteler]:
> What is the status of this report?

swig/python/Makefile has changed beyond recognition since this was
originally filed. Linking now uses `$(CXX)`.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/411#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#411: Makefile uses LD instead of GCC for linking leads to undefined symbol:
__stack_chk_fail_local
----------------------------------+-----------------------------------------
  Reporter: RRosario | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: closed
  Priority: major | Milestone: 6.4.0
Component: SWIG (all bindings) | Version: svn-develbranch6
Resolution: fixed | Keywords: undefined symbol __stack_chk_fail_local
  Platform: Linux | Cpu: x86-32
----------------------------------+-----------------------------------------
Changes (by hamish):

  * status: new => closed
  * resolution: => fixed

Comment:

apparently it is non-trivial to add a new "obsolete" resolved status, so
just calling this fixed.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/411#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>