I know your problem very well, I have the same.
If a 64-bit system is not absolutely necessary for your use case, prefer @joq answer instead of mine!
I compile my node with the flags:
set_target_properties(asr_node PROPERTIES COMPILE_FLAGS "-m32 -fPIC")
set_target_properties(asr_node PROPERTIES LINK_FLAGS -m32)
Now the headache part begins.
As @raul.perula stated the flags alone aren't sufficient. The libraries your package depends on are also required in 32 bit. So, I deliver the required ROS libraries (and some others) in 32-bit binaries with my package. Other system side dependencies I install as rosdeps. For others that aren't installable with rosdep I perform a check in my CMakeLists.txt and for the case they aren't installed I print a apt-get install
command to install them. (So yes my system is polluted with 32-bit crap everywhere)
Sounds dirty and in my opinion it is dirty, but I got a 32 bit node running with a 64 bit ROS and it works like a charm.