Recent change in GNU turned "--as-needed" for ld as default, which causes this issue.
To address this, open the model "ROS2ValetPathPlannerExample.slx", navigate to "Configuration Setting->Simulation Target->Linker flags" in and add "-Wl,--no-as-needed" (No quote)