Menu

-fsanitize=undefined error

Help
2017-05-04
2017-05-04
  • Nicholas Welna

    Nicholas Welna - 2017-05-04

    I am attempting to use -fsanitize=undefined as a flag in a C++ project I am compiling using MinGW-w64, but it doesn't seem to work, it just errors out:

    g++ ShipmentMaker.o ShippingSimulation.o VesselEvent.o Port.o Event.o Shipment.o EVentGreaterThan.o -o GopherShipping.exe -MP -MD -std=c++11 -march=native -Wall -Wextra -fstack-protector-strong -fsanitize=undefined
    
    E:/Program Files/mingw-w64/x86_64-6.3.0-posix-seh-rt_v5-rev2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lubsan
    
    collect2.exe: error: ld returned 1 exit status
    
    makefile:21: recipe for target 'GopherShipping.exe' failed
    
    mingw32-make: *** [GopherShipping.exe] Error 1
    

    Is there any way I can fix it?

     
    • Kai Tietz

      Kai Tietz - 2017-05-04

      Well, you would need build ( and to port - I guess) the library ubsan
      (-lubsan). If you can manage this, the option should work. The
      sources of this library can be found in gcc's repository AFAIR.

      Regards,
      Kai

      2017-05-04 5:29 GMT+02:00 Nicholas Welna nwelna@users.sf.net:

      I am attempting to use -fsanitize=undefined as a flag in a C++ project I am
      compiling using MinGW-w64, but it doesn't seem to work, it just errors out:

      g++ ShipmentMaker.o ShippingSimulation.o VesselEvent.o Port.o Event.o
      Shipment.o EVentGreaterThan.o -o GopherShipping.exe -MP -MD -std=c++11
      -march=native -Wall -Wextra -fstack-protector-strong -fsanitize=undefined

      E:/Program
      Files/mingw-w64/x86_64-6.3.0-posix-seh-rt_v5-rev2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
      cannot find -lubsan

      collect2.exe: error: ld returned 1 exit status

      makefile:21: recipe for target 'GopherShipping.exe' failed

      mingw32-make: *** [GopherShipping.exe] Error 1

      Is there any way I can fix it?


      -fsanitize=undefined error


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/mingw-w64/discussion/723798/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

Log in to post a comment.